Motion detection method, device, computer equipment and storage medium
By generating the event matrix and performing projection filtering, the problem of poor robustness of existing motion detection methods is solved, and higher detection accuracy and stability are achieved.
Patent Information
- Application Number
- CN202111389133.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-22
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2041-11-22
AI Technical Summary
The existing motion detection methods are insufficient in terms of robustness. The background subtraction method is applicable to scenes, and the frame difference method is prone to noise and is affected by lighting. The event camera cannot determine the range of the motion area based on the event count statistics, and the noise is high and the robustness is poor.
By obtaining the EVS event data of the event output device, an event matrix is generated, and projected to filter out invalid events, generate current valid projection information, and finally determine the motion area.
The accuracy and robustness of motion detection are improved, and the accuracy and stability of motion detection are improved through matrix generation and projection filtering.
Smart Images

Figure CN114078231B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image data processing, and in particular relates to a motion detection method, device, computer equipment and storage medium. Background Art
[0002] Motion detection, whose primary purpose is to detect the movement of moving objects, is commonly used in scenarios such as security monitoring and the smart Internet of Things to determine the range of motion. Common detection methods include background subtraction, frame difference, and detection based on the number of events recorded by event cameras.
[0003] However, existing detection methods all have drawbacks. For example, the background subtraction method is limited in its applicable scenarios and is only applicable to videos where the first frame is a background image. The frame difference method easily generates a large amount of noise information and is easily affected by the lighting in the environment, resulting in poor robustness. Motion detection based on event count statistics in event cameras cannot determine the scope of the motion area because it simply counts the number of events in the event camera, resulting in high noise and poor robustness.
[0004] Therefore, it is necessary to design a motion detection method, device, computer equipment and storage medium to solve the defects in the existing technology. Summary of the Invention
[0005] The object of the present invention is to provide a motion detection method, apparatus, computer equipment and storage medium, aiming to solve the technical problem of poor robustness of the moving object detection method in the prior art.
[0006] To achieve the above-mentioned object, an embodiment of the present invention provides a motion detection method, which is applied to an event output device and specifically includes the following steps:
[0007] Acquire EVS event data output by the event output device, and generate an event matrix according to the EVS event data;
[0008] Projecting the event matrix and generating initial projection information;
[0009] Filtering out invalid events from the initial projection information and generating current valid projection information;
[0010] A motion region is obtained according to the current valid projection information.
[0011] Optionally, filtering out invalid events from the initial projection information and generating current valid projection information specifically includes:
[0012] Performing invalid projection point filtering on the initial projection information to obtain valid event projection information;
[0013] Invalid event length filtering is performed on the valid event projection information to obtain current valid projection information.
[0014] Optionally, the initial projection information includes current moment projection information and previous moment projection information, and the current moment projection information is projection information corresponding to the current moment;
[0015] The current moment projection information and the previous moment projection information each include a plurality of projection points, and the values of the projection points represent the number of events;
[0016] The previous moment projection information is projection information corresponding to a previous moment, and the previous moment is a moment before the current moment;
[0017] The filtering of invalid projection points on the initial projection information to obtain valid event projection information specifically includes:
[0018] updating the projection information at the current moment according to the projection information at the previous moment, and generating updated current projection information;
[0019] The projection points whose values in the updated current projection information are smaller than a preset first standard value are set as invalid projection points, and valid event projection information is obtained after the setting.
[0020] Optionally, updating the projection information at the current moment according to the projection information at the previous moment and generating updated current projection information specifically includes:
[0021] Acquire projection difference information between the projection information at the previous moment and the projection information at the current moment;
[0022] The current moment projection information is updated according to the projection difference information, and updated current projection information is generated.
[0023] Optionally, a projection point with a non-zero value in the valid event projection information is a valid projection point;
[0024] The performing invalid event length filtering on the valid event projection information to obtain current valid projection information specifically includes:
[0025] Obtain projection points with zero values between adjacent valid projection points in the valid event projection information, and record them as projection points to be filtered;
[0026] Determining whether the number of the projection points to be filtered is less than a preset second standard value;
[0027] If the answer is yes, the preset third standard value is set as the value of the projection point to be filtered, and the current valid projection information is obtained after the setting.
[0028] Optionally, the currently valid projection information includes valid projection information at a first moment, valid projection information at a current moment, and valid projection information at a second moment;
[0029] The obtaining of the motion region according to the current valid projection information specifically includes:
[0030] generating final projection data according to the first-moment valid projection information, the current-moment valid projection information, and the second-moment valid projection information;
[0031] According to the final projection data, the motion area is obtained.
[0032] Optionally, the final projection data includes X-direction projection data and Y-direction projection data.
[0033] The step of obtaining the motion region according to the final projection data specifically includes:
[0034] Acquiring X-direction motion range data from the X-direction projection data;
[0035] Acquiring Y-direction motion range data from the Y-direction projection data;
[0036] A motion area is determined according to the X-direction motion range data and the Y-direction motion range data.
[0037] Optionally, the present invention further provides a motion detection device, which is applied to an event output device and includes:
[0038] A matrix generation module, configured to obtain EVS event data output by the event output device and generate an event matrix based on the EVS event data;
[0039] A projection generation module, configured to project the event matrix and generate initial projection information;
[0040] An event filtering module, configured to filter out invalid events from the initial projection information and generate current valid projection information;
[0041] The region generating module is configured to obtain a motion region according to the current valid projection information.
[0042] Optionally, the present invention further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the motion detection method when executing the computer program.
[0043] Optionally, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the motion detection method when executed by a processor.
[0044] The above one or more technical solutions in the motion detection method, apparatus, computer device, and storage medium provided by the embodiments of the present invention have at least one of the following technical effects:
[0045] The present invention obtains EVS event data output by an event output device, generates an event matrix, and projects the event matrix to generate initial projection information. Then, invalid events are filtered out of the initial projection information, and current valid projection information is generated. Finally, a motion area is obtained based on the current valid projection information. Compared with the existing technology, the motion area is finally obtained by first performing matrix generation and projection, then filtering, thereby improving the accuracy of motion detection and the robustness of the motion detection process. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0047] Figure 1 A schematic diagram of the overall process of the motion detection method provided by an embodiment of the present invention;
[0048] Figure 2 A schematic diagram of an event matrix provided by an embodiment of the present invention;
[0049] Figure 3 A schematic diagram of a process for generating initial projection information provided by an embodiment of the present invention;
[0050] Figure 4 A schematic diagram of a process for generating current valid projection information provided by an embodiment of the present invention;
[0051] Figure 5 A schematic diagram of a process for obtaining valid event projection information provided by an embodiment of the present invention;
[0052] Figure 6 A schematic diagram of a process for generating updated current projection information provided by an embodiment of the present invention;
[0053] Figure 7 A schematic diagram of a process for obtaining current valid projection information provided by another embodiment of the present invention;
[0054] Figure 8 A schematic diagram of a process for obtaining a motion region according to an embodiment of the present invention;
[0055] Figure 9 A schematic diagram of a flow chart for obtaining a motion region according to another embodiment of the present invention;
[0056] Figure 10 A schematic diagram of a motion area provided by an embodiment of the present invention;
[0057] Figure 11 A structural block diagram of a motion detection device provided by an embodiment of the present invention;
[0058] Figure 12 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0059] The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the embodiments of the present invention, and should not be construed as limiting the present invention.
[0060] In the description of the embodiments of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the embodiments of the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention.
[0061] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present invention, "plurality" means two or more, unless otherwise specifically defined.
[0062] In the embodiments of the present invention, unless otherwise expressly specified or limited, the terms "installed," "connected," "connected," "fixed," etc. should be understood in a broad sense. For example, they may refer to fixed connection, detachable connection, or integration; mechanical connection or electrical connection; direct connection or indirect connection through an intermediate medium; internal communication between two components or interaction between two components. Those skilled in the art will understand the specific meanings of the above terms in the embodiments of the present invention based on specific circumstances.
[0063] In one embodiment of the present invention, Figure 1As shown, a motion detection method is provided, which is applied to an event output device and specifically includes the following steps:
[0064] Step S100: acquiring EVS event data output by an event output device, and generating an event matrix according to the EVS event data;
[0065] In this step, the event output device is a device that can output event signals, such as an EVS camera or pixel array. The EVS event data is data output by the event output device for representing the event. Figure 2 As shown, after a pixel array outputs EVS event data and generates an event matrix, a value of 1 in the event matrix 110 indicates an event, and a value of 0 indicates no event.
[0066] Specifically, the event matrix can be split into multiple local matrices, each of which, when aggregated, still forms the event matrix. For example, each local matrix can be configured as a 3x3 matrix, a 4x4 matrix, or other matrix. Adjacent local matrices can have repeated rows and columns, such as repeating one or two rows between adjacent 3x3 matrices. By splitting the local matrices, data can be processed locally, improving efficiency and accuracy.
[0067] Step S200: Projecting the event matrix and generating initial projection information;
[0068] Specifically, projection is performed to facilitate subsequent data processing. The projection includes projection in the X direction and projection in the Y direction, that is, the initial projection information includes initial X-direction projection information and initial Y-direction projection information, wherein the projection in the X direction is the sum of non-zero pixel values in a row, and similarly, the projection in the Y direction is the sum of non-zero pixel values in a column. Figure 2 For example, the projection information in the event matrix 110 after projection in the X direction is represented by [2, 2, 2], and the projection information after projection in the Y direction is represented by [2, 3, 1]. The projection points in the initial X-direction projection information and the initial Y-direction projection information guarantee the total number of events in the row or column.
[0069] Step S300: filtering out invalid events from the initial projection information and generating current valid projection information;
[0070] In this step, invalid events are filtered out from the initial projection information to filter out interference events, thereby improving the accuracy of the acquired information.
[0071] Step S400: obtaining a motion region according to the current valid projection information.
[0072] The present invention obtains EVS event data output by an event output device, generates an event matrix, and projects the event matrix to generate initial projection information. Then, invalid events are filtered out of the initial projection information, and current valid projection information is generated. Finally, a motion area is obtained based on the current valid projection information. Compared with the existing technology, the motion area is finally obtained by first performing matrix generation and projection, then filtering, thereby improving the accuracy of motion detection and the robustness of the motion detection process.
[0073] In another embodiment of the present invention, Figure 3 As shown, step S200: projecting the event matrix and generating initial projection information, specifically includes:
[0074] Step S210: performing noise filtering on the event matrix to obtain a filtered event matrix;
[0075] In this step, noise filtering is performed to remove noise information. Specifically, it is determined whether the number of non-zero values in the event matrix is greater than or equal to the preset standard qualified number. If the determination is no, the center point of the event matrix is an invalid value, that is, a noise point. If the determination is yes, the center point of the event matrix is a valid value. The standard qualified number is set as needed, such as 3. Figure 2 For example, the number of non-zero values in the event matrix 110 is 6, then 6 is greater than 3, and the point in the event matrix 110 is a valid value.
[0076] Step S220: Projecting the filtered event matrix to generate initial projection information.
[0077] In this step, by projecting the filtered event matrix, the initial projection information obtained is accurate, thereby improving the accuracy of subsequent data processing.
[0078] In another embodiment of the present invention, Figure 4 As shown, step S300: filtering out invalid events from the initial projection information and generating current valid projection information, specifically includes:
[0079] Step S310: filtering the initial projection information for invalid projection points to obtain valid event projection information;
[0080] In this step, invalid projection point filtering is performed on the initial projection information to filter out local projection points caused by interference.
[0081] Step S320: performing invalid event length filtering on the valid event projection information to obtain current valid projection information.
[0082] In this step, invalid event length filtering is performed on the valid event projection information to filter out invalid event lengths and smaller isolated parts, and then invalid projection point filtering is performed first, and then invalid event length filtering is performed, so that the obtained valid projection information is true, accurate and valid.
[0083] In another embodiment of the present invention, Figure 5 As shown, the initial projection information includes current moment projection information and previous moment projection information, and the current moment projection information is the projection information corresponding to the current moment.
[0084] The current moment projection information and the previous moment projection information each include a plurality of projection points, and the values of the projection points represent the number of events;
[0085] The previous moment projection information is projection information corresponding to a previous moment, and the previous moment is a moment before the current moment.
[0086] In this embodiment, the current time is denoted by t2, and the previous time is denoted by t1. Taking the X-direction projection information as an example, assuming that the X-direction projection information in the projection information at the current time is [0, 1, 2, 3, 4, 5, 7, 8, 9, 9, 10, 11, 12], and the X-direction projection information in the projection information at the previous time is [1, 2, 3, 4, 0, 6, 7, 8, 9, 10, 11, 12, 0] as an example, it can be seen that the number of projection points in the X-direction at time t2 and time t1 is 13, and each value represents the number of events.
[0087] Step S310: Filtering invalid projection points on the initial projection information to obtain valid event projection information, specifically including:
[0088] Step S311: updating the current moment projection information according to the previous moment projection information, and generating updated current projection information;
[0089] Specifically, in this step, the stroboscopic problem is solved by updating the projection information at the current moment.
[0090] Further, if Figure 6 As shown, in this step, step S311 specifically includes the following steps:
[0091] Step S3111: obtaining projection difference information between the projection information at the previous moment and the projection information at the current moment;
[0092] The projection difference is obtained by subtracting the projections in the X direction at time t2 and time t1, and taking the absolute value. That is, the values of each projection point in [0, 1, 2, 3, 4, 5, 7, 8, 9, 9, 10, 11, 12] are subtracted from the values of each projection point in [1, 2, 3, 4, 0, 6, 7, 8, 9, 10, 11, 12, 0] and taking the absolute value. The projection difference information can be obtained. In this embodiment, the projection difference information is [1, 1, 1, 1, 4, 1, 0, 0, 0, 1, 1, 12].
[0093] Step S3112: updating the current projection information according to the projection difference information, and generating updated current projection information.
[0094] In this step, the current moment projection information is updated by performing an AND operation on the projection difference information and the current moment projection information. In this embodiment, the projection difference information [1, 1, 1, 1, 4, 1, 0, 0, 0, 1, 1, 1, 12] is ANDed with the corresponding value [0, 1, 2, 3, 4, 5, 7, 8, 9, 9, 10, 11, 12] at time t2. The updated current projection information generated after the AND operation is [0, 1, 2, 3, 4, 5, 0, 0, 0, 9, 10, 11, 12]. It should be understood that if the AND operation results in a non-zero value, the original value at the current moment is retained. For example, the first value 1 in the projection difference information and the first value 0 at time t2 are ANDed to 0, which is the first value in the updated current projection information. Subsequently, the second value 1 in the projection difference information and the corresponding value 1 at time t2 are ANDed to maintain the value at time t2, i.e., the result is 1. The same principle applies to the subsequent steps, and no further examples will be given.
[0095] Step S312: setting the projection points whose values in the updated current projection information are smaller than a preset first standard value as invalid projection points, and obtaining valid event projection information after setting.
[0096] Specifically, in this step, the first standard value is pre-set. By setting different first standard values, different time numbers are defined as invalid projection points. For example, if the first standard value is set to 2, then in this step, the projection points corresponding to values less than 2 are determined to be invalid projection points, and the values of the projection points set as invalid projection points are set to 0. For example, when the current projection information after the update is [0, 1, 2, 3, 4, 5, 0, 0, 0, 9, 10, 11, 12], after this step, the valid event projection information is [0, 0, 2, 3, 4, 5, 0, 0, 0, 9, 10, 11, 12].
[0097] In another embodiment of the present invention, Figure 7As shown, the projection point with a non-zero value in the valid event projection information is a valid projection point;
[0098] Step S320: performing invalid event length filtering on the valid event projection information to obtain current valid projection information, specifically including:
[0099] Step S321: obtaining projection points with a value of zero between adjacent valid projection points in the valid event projection information, and recording them as projection points to be filtered;
[0100] Specifically, taking the valid event projection information as [0, 0, 2, 3, 4, 5, 0, 0, 0, 9, 10, 11, 12] as an example, the values of the 1st, 2nd, 7th, 8th, and 9th projection points are 0, and the projections with the remaining non-zero values are valid projection points. The projection points with zero values between adjacent valid projection points are the 7th, 8th, and 9th projection points, which are also the projection points to be filtered.
[0101] Step S322: determining whether the number of the projection points to be filtered is less than a preset second standard value;
[0102] The second standard value is pre-set and used to filter out isolated event-free portions. Different second standard values can be set to filter out event-free portions of different lengths. The second standard value can be set to 5.
[0103] Step S323: If the answer is yes, the preset third standard value is set as the value of the projection point to be filtered, and the current valid projection information is obtained after the setting.
[0104] Wherein, the third standard value is pre-set and used to fill the projection points occupied by the isolated part to be filtered. In this step, if the judgment is yes, it is to judge that the number of the projection points to be filtered is less than the preset second standard value. Taking the valid event projection information as [4, 6, 2, 3, 4, 5, 0, 0, 0, 9, 10, 11, 12] and the second standard value as 5 as an example, then the number of the projection points to be filtered is 3 at this time. It can be judged that the number of the projection points to be filtered is less than the second standard value, then it is necessary to set the preset third standard value as the value of the projection points to be filtered. At this time, taking the third standard value as 5 as an example, [4, 6, 2, 3, 4, 5, 5, 5, 5, 9, 10, 11, 12] can be obtained, that is, the current valid projection information is obtained.
[0105] In another embodiment of the present invention, Figure 8As shown, the currently valid projection information includes the valid projection information at the first moment, the valid projection information at the current moment, and the valid projection information at the second moment. The valid projection information at the first moment is the projection information corresponding to the first moment, the valid projection information at the second moment is the projection information corresponding to the second moment, the valid projection information at the current moment is the projection information corresponding to the current moment, and the first moment and the second moment are any moments other than the current moment.
[0106] Step S400: Obtaining a motion region based on the current valid projection information, specifically including:
[0107] Step S410: generating final projection data according to the valid projection information at the first moment, the valid projection information at the current moment, and the valid projection information at the second moment;
[0108] Specifically, the final projection data is generated by performing an AND operation on the valid projection information at the first moment, the valid projection information at the second moment, and the valid projection information at the current moment. In this embodiment, the value that is not 0 after the AND operation will retain the value of the projection point corresponding to the current moment.
[0109] Taking the valid projection information at the first moment and the valid projection information at the second moment as [1, 1, 1, 1, 1, 5, 3, 5, 9, 10, 11, 12, 0, 0] and [0, 1, 2, 1, 1, 1, 5, 3, 5, 9, 10, 11, 12, 1, 1] respectively, and the valid projection information at the current moment is [0, 0, 2, 3, 4, 5, 5, 5, 9, 10, 11, 12] as an example, the final projection data generated is [0, 0, 2, 5, 5, 5, 5, 5, 9, 10, 0, 0].
[0110] Step S420: Obtain the motion area according to the final projection data.
[0111] Specifically, the final projection data includes X-direction projection data and Y-direction projection data, such as Figure 9 As shown, obtaining the motion region according to the final projection information specifically includes the following steps:
[0112] Step S421: Acquire X-direction motion range data from the X-direction projection data;
[0113] Specifically, in this step, the X-direction motion range data is obtained by indexing the X-direction projection data. The first non-zero value from the left and the first non-zero value from the right in the X-direction motion range data are taken as the two end values. For example, if the X-direction motion range data is [0, 5, 5, 5, 5, 5, 5, 5, 9, 10, 11, 12, 0], then the X-direction motion range data is [2, 13].
[0114] Step S422: Acquire Y-direction motion range data from the Y-direction projection data;
[0115] In this step, the steps for obtaining the Y-direction motion range data are the same as those for obtaining the X-direction motion range data, and thus will not be described in detail.
[0116] Step S423: determining a motion region according to the X-direction motion range data and the Y-direction motion range data.
[0117] Specifically, in this embodiment, when the X-direction motion range data is [2, 13], and if the Y-direction motion range data is [3, 7], the following can be obtained: Figure 10 The motion area shown.
[0118] In another embodiment of the present invention, Figure 11 As shown, a motion detection device is also provided, which is applied to an event output device and includes a matrix generation module 100 , a projection generation module 200 , an event filtering module 300 and a region generation module 400 .
[0119] The matrix generation module 100 is used to obtain EVS event data output by the event output device and generate an event matrix according to the EVS event data;
[0120] The projection generation module 200 is used to project the event matrix and generate initial projection information;
[0121] The event filtering module 300 is used to filter out invalid events from the initial projection information and generate current valid projection information;
[0122] The region generating module 400 is configured to obtain a motion region according to the current valid projection information.
[0123] In another embodiment of the present invention, the event filtering module 300 is further configured to: update the projection information at the current moment according to the projection information at the previous moment, and generate updated current projection information; set projection points in the updated current projection information whose values are less than a preset first standard value as invalid projection points, and obtain valid event projection information after setting;
[0124] In another embodiment of the present invention, the event filtering module 300 is further used to: obtain projection difference information between the projection information at the previous moment and the projection information at the current moment; update the projection information at the current moment according to the projection difference information, and generate updated current projection information.
[0125] In another embodiment of the present invention, the event filtering module 300 is further used to: obtain projection points with a value of zero between adjacent valid projection points in the valid event projection information, and record them as projection points to be filtered; determine whether the number of projection points to be filtered is less than a preset second standard value; if the judgment is yes, set the preset third standard value as the value of the projection point to be filtered, and obtain the current valid projection information after setting.
[0126] In another embodiment of the present invention, the region generating module 400 is further configured to: generate final projection data based on the first moment effective projection information, the current moment effective projection information, and the second moment effective projection information; and obtain the motion region based on the final projection data;
[0127] In another embodiment of the present invention, the region generation module 400 is further configured to: obtain X-direction motion range data from the X-direction projection data; obtain Y-direction motion range data from the Y-direction projection data; and determine a motion region based on the X-direction motion range data and the Y-direction motion range data.
[0128] In another embodiment of the present invention, the projection generation module 200 is further configured to: perform noise filtering on the event matrix to obtain a filtered event matrix, and project the filtered event matrix to generate initial projection information.
[0129] The specific definition of the motion detection device can be found in the definition of the motion detection method above and will not be repeated here. Each module in the above-mentioned motion detection device can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor of the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each of the above modules.
[0130] In another embodiment of the present invention, Figure 12 As shown, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the motion detection method when executing the computer program.
[0131] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 12As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a motion detection method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0132] Those skilled in the art will understand that Figure 12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0133] In another embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the motion detection method are implemented.
[0134] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0135] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A motion detection method, characterized in that: The method is applied to an event output device and specifically comprises the following steps: Acquire EVS event data output by the event output device, and generate an event matrix according to the EVS event data; Projecting the event matrix and generating initial projection information; the initial projection information includes current moment projection information and previous moment projection information, the current moment projection information being projection information corresponding to the current moment; updating the projection information at the current moment according to the projection information at the previous moment, and generating updated current projection information; Setting the projection points whose values in the updated current projection information are less than a preset first standard value as invalid projection points, and obtaining valid event projection information after setting; The projection point with a non-zero value in the valid event projection information is a valid projection point; Obtain projection points with zero values between adjacent valid projection points in the valid event projection information, and record them as projection points to be filtered; Determining whether the number of the projection points to be filtered is less than a preset second standard value; If the judgment is yes, the preset third standard value is set as the value of the projection point to be filtered, and the current valid projection information is obtained after the setting; A motion region is obtained according to the current valid projection information.
2. The motion detection method according to claim 1, wherein: The current moment projection information and the previous moment projection information each include a plurality of projection points, and the values of the projection points represent the number of events; The previous moment projection information is projection information corresponding to a previous moment, and the previous moment is a moment before the current moment.
3. The motion detection method according to claim 2, wherein: The updating of the projection information at the current moment according to the projection information at the previous moment and generating updated current projection information specifically includes: Acquire projection difference information between the projection information at the previous moment and the projection information at the current moment; The current moment projection information is updated according to the projection difference information, and updated current projection information is generated.
4. The motion detection method according to any one of claims 1 to 3, characterized in that: The currently valid projection information includes valid projection information at the first moment, valid projection information at the current moment, and valid projection information at the second moment; The obtaining of the motion region according to the current valid projection information specifically includes: generating final projection data according to the first-moment valid projection information, the current-moment valid projection information, and the second-moment valid projection information; According to the final projection data, the motion area is obtained.
5. The motion detection method according to claim 4, characterized in that: The final projection data includes X-direction projection data and Y-direction projection data. The step of obtaining the motion region according to the final projection data specifically includes: Acquiring X-direction motion range data from the X-direction projection data; Acquiring Y-direction motion range data from the Y-direction projection data; A motion area is determined according to the X-direction motion range data and the Y-direction motion range data.
6. A motion detection device, characterized in that: The device is applied to an event output device, and the device includes: A matrix generation module, configured to obtain EVS event data output by the event output device and generate an event matrix based on the EVS event data; A projection generation module, configured to project the event matrix and generate initial projection information; the initial projection information includes current moment projection information and previous moment projection information, wherein the current moment projection information is projection information corresponding to the current moment; An event filtering module is configured to update the projection information at the current moment based on the projection information at the previous moment and generate updated current projection information; set projection points in the updated current projection information whose values are less than a preset first standard value as invalid projection points, and obtain valid event projection information after setting; and define projection points with non-zero values in the valid event projection information as valid projection points; and further configured to obtain projection points with zero values between adjacent valid projection points in the valid event projection information and record them as projection points to be filtered; determine whether the number of projection points to be filtered is less than a preset second standard value; if so, set a preset third standard value as the value of the projection point to be filtered, and obtain current valid projection information after setting; The region generating module is configured to obtain a motion region according to the current valid projection information.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Dynamic target detection method based on event camera
CN111931752A