Animal monitoring method, device, terminal equipment and storage medium
By acquiring video streams through urban surveillance cameras and using deep neural networks for image processing, information on stray wild animals can be identified and saved, solving the high cost and low efficiency problems of urban animal monitoring and achieving low-cost comprehensive monitoring effects.
Patent Information
- Application Number
- CN202211693328.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-12-28
AI Technical Summary
Existing technologies in urban animal monitoring have problems of high cost and low efficiency, making it difficult to fully cover the monitoring needs of urban animals.
Use urban surveillance cameras to obtain video streams, use deep neural networks to decode image frames and recognize targets, and identify and save information about stray wild animal targets in a database.
It has achieved low-cost and comprehensive urban animal monitoring, especially the identification and tracking of stray wild animals, and improved monitoring efficiency and coverage.
Smart Images

Figure CN116307357B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of animal monitoring, and in particular to an animal monitoring method, apparatus, terminal equipment and storage medium. Background Art
[0002] With the optimization of urban greening environments and ecological construction in recent years, the number of urban wild animals has increased significantly, and wild animals often enter human activity areas. On the other hand, more and more families are starting to keep pets. To achieve harmonious coexistence between humans and animals and ensure the quality of life and safety of residents, we must strengthen the protection of wild animals and control and rescue stray animals.
[0003] Currently, the monitoring and management of urban animals still mainly relies on residents' active reporting, manual inspections organized by the government or scientific research groups, or scientific research teams using infrared cameras to monitor urban wild animals. These methods require manpower or materials to deploy special infrared cameras. Due to the lack of relevant animal activity information, the deployment locations are also very random, making it difficult to ensure observation efficiency. At the same time, the purchase and maintenance of infrared cameras also require additional financial investment.
[0004] Therefore, how to conduct comprehensive monitoring of urban animals at low cost is an urgent problem to be solved. Summary of the Invention
[0005] The main purpose of this application is to provide an animal monitoring method, apparatus, terminal device and storage medium, aiming to solve the problem of how to monitor urban animals at low cost.
[0006] To achieve the above objectives, the present application provides an animal monitoring method, which comprises the following steps:
[0007] Get video streams from city surveillance cameras;
[0008] Decoding the video stream to obtain video image frames;
[0009] Inputting the video image frame into a pre-obtained deep neural network inference module to obtain a plurality of targets in the video image frame and positioning frames of the plurality of targets;
[0010] Identify stray wild animal targets among the multiple targets, save the stray wild animal targets and related information to a database and display them.
[0011] Optionally, the step of identifying stray wild animal targets among the plurality of targets, storing the stray wild animal targets and related information in a database, and displaying the same includes:
[0012] If the target is identified as an animal target, the animal target is input into a preset feature extraction neural network inference module to extract features of the animal target;
[0013] determining whether the animal target is a cat or a dog according to the characteristics of the animal target;
[0014] If the animal target is not a cat or a dog, it is determined that the animal target is a stray wild animal target;
[0015] The relevant information of the animal target is saved in a database and displayed.
[0016] Optionally, after the step of determining whether the animal target is a cat or a dog based on the characteristics of the animal target, and before the step of storing and displaying the relevant information of the animal target in a database, the method further includes:
[0017] If the animal target is a cat or a dog, it is determined whether the animal target is a stray wild animal target.
[0018] Optionally, if the animal target is a cat or a dog, the step of determining whether the animal target is a stray wild animal target includes:
[0019] If the animal target is a cat or a dog, determining whether there is a pedestrian target among the multiple targets;
[0020] If the pedestrian target exists, matching the trajectory of the pedestrian target with the trajectory of the animal target according to the target tracking algorithm;
[0021] If the running trajectory is matched successfully, the monitoring ends;
[0022] If the running trajectory fails to match, it is determined that the animal target is a stray wild animal target.
[0023] Optionally, if the animal target is a cat or a dog, after the step of determining whether there is a pedestrian target among the multiple targets, the step further includes:
[0024] If the pedestrian target does not exist, it is determined that the animal target is a stray wild animal target.
[0025] Optionally, the step of storing and displaying the relevant information of the animal target in a database includes:
[0026] Associating the relevant information of the animal target with the recorded data in the database;
[0027] If the association is successful, the features in the recorded data are matched with the features of the animal target.
[0028] Optionally, if the association is successful, the step of matching the features in the recorded data with the features of the animal target includes:
[0029] If the features in the recorded data successfully match the features of the animal target, updating the successfully matched recorded data;
[0030] If the features in the recorded data fail to match the features of the animal target, new recorded data of the animal target is created.
[0031] The present application also provides an animal monitoring device, which includes:
[0032] Acquisition module, used to obtain video streams from city surveillance cameras;
[0033] A decoding module, configured to decode the video stream to obtain video image frames;
[0034] A positioning module, configured to input the video image frame into a pre-obtained deep neural network inference module to obtain a plurality of targets in the video image frame and positioning frames of the plurality of targets;
[0035] The identification module is used to identify stray wild animal targets among the multiple targets, save the stray wild animal targets and related information to a database and display them.
[0036] The implementation case of this application also proposes a terminal device, which includes a memory, a processor, and an animal monitoring program stored in the memory and executable on the processor. When the animal monitoring program is executed by the processor, the steps of the animal monitoring method are implemented.
[0037] The implementation case of the present application also proposes a storage medium, on which an animal monitoring program is stored. When the animal monitoring program is executed by a processor, the steps of the animal monitoring method are implemented.
[0038] The present application proposes an animal monitoring method, apparatus, terminal device, and storage medium. The method involves acquiring a video stream from a city surveillance camera; decoding the video stream to obtain a video image frame; inputting the video image frame into a pre-obtained deep neural network inference module to obtain a number of targets in the video image frame and positioning frames for the targets; identifying stray wild animal targets among the targets, and storing and displaying the stray wild animal targets and related information in a database. Based on this application, the identification and monitoring of urban animals through city cameras is achieved, achieving the effect of low-cost comprehensive monitoring of animals in the city. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is a schematic diagram of the functional modules of the terminal device of the animal monitoring device of this application;
[0040] Figure 2 This is a flow chart of a first exemplary embodiment of the animal monitoring method of the present application;
[0041] Figure 3 This is a flow chart of a second exemplary embodiment of the animal monitoring method of the present application;
[0042] Figure 4 This is a flow chart of a third exemplary embodiment of the animal monitoring method of the present application;
[0043] Figure 5 This is a flow chart of a fourth exemplary embodiment of the animal monitoring method of the present application;
[0044] Figure 6 This is a flow chart of a fifth exemplary embodiment of the animal monitoring method of the present application;
[0045] Figure 7 This is a functional flow chart of a sixth exemplary embodiment of the animal monitoring method of the present application.
[0046] The realization of the objectives, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0047] It should be understood that the specific implementation cases described herein are only used to explain the present application and are not used to limit the present application.
[0048] The main solution of this embodiment is to obtain a video stream from a city surveillance camera; decode the video stream to obtain video image frames; input the video image frames into a pre-established deep neural network inference module to obtain multiple targets in the video image frames and their positioning frames; identify stray wild animal targets among the multiple targets, and save and display the stray wild animal targets and related information in a database. Based on this solution, low-cost identification and monitoring of urban animals is achieved, achieving the goal of monitoring animals in cities.
[0049] Specifically, refer to Figure 1 , Figure 1 This is a functional module diagram of the terminal device to which the animal monitoring device of this application belongs. The animal monitoring device is a terminal device-based device that can comprehensively monitor urban animals and can be hosted on the terminal device in the form of hardware or software.
[0050] In this embodiment, the terminal device to which the animal monitoring apparatus belongs includes at least an output module 110 , a processor 120 , a memory 130 and a communication module 140 .
[0051] Memory 130 stores an operating system and an animal monitoring program. The animal monitoring device can capture video streams from city surveillance cameras, decode the video streams to obtain video image frames, input the video image frames into a pre-established deep neural network inference module, obtain multiple targets in the video image frames and their positioning frames, identify stray wild animal targets among the multiple targets, save the stray wild animal targets and related information to a database, and display and store such information in memory 130. Output module 110 can be a display screen, etc. Communication module 140 can include a Wi-Fi module, a mobile communication module, and a Bluetooth module, etc., and communicates with external devices or servers through communication module 140.
[0052] The animal monitoring program in the memory 130 implements the following steps when executed by the processor:
[0053] Get video streams from city surveillance cameras;
[0054] Decoding the video stream to obtain video image frames;
[0055] Inputting the video image frame into a pre-obtained deep neural network inference module to obtain a plurality of targets in the video image frame and positioning frames of the plurality of targets;
[0056] Identify stray wild animal targets among the multiple targets, save the stray wild animal targets and related information to a database and display them.
[0057] Furthermore, when the animal monitoring program in the memory 130 is executed by the processor, the following steps are also implemented:
[0058] If the target is identified as an animal target, the animal target is input into a preset feature extraction neural network inference module to extract features of the animal target;
[0059] determining whether the animal target is a cat or a dog according to the characteristics of the animal target;
[0060] If the animal target is not a cat or a dog, it is determined that the animal target is a stray wild animal target;
[0061] The relevant information of the animal target is saved in a database and displayed.
[0062] Furthermore, when the animal monitoring program in the memory 130 is executed by the processor, the following steps are also implemented:
[0063] If the animal target is a cat or a dog, it is determined whether the animal target is a stray wild animal target.
[0064] Furthermore, when the animal monitoring program in the memory 130 is executed by the processor, the following steps are also implemented:
[0065] If the pedestrian target exists, matching the trajectory of the pedestrian target with the trajectory of the animal target according to the target tracking algorithm;
[0066] If the running trajectory is matched successfully, the monitoring ends;
[0067] If the running trajectory fails to match, it is determined that the animal target is a stray wild animal target.
[0068] Furthermore, when the animal monitoring program in the memory 130 is executed by the processor, the following steps are also implemented:
[0069] If the pedestrian target does not exist, it is determined that the animal target is a stray wild animal target.
[0070] Furthermore, when the animal monitoring program in the memory 130 is executed by the processor, the following steps are also implemented:
[0071] Associating the relevant information of the animal target with the recorded data in the database;
[0072] If the association is successful, the features in the recorded data are matched with the features of the animal target.
[0073] Based on the above terminal device architecture but not limited to the above architecture, an embodiment of the method of the present application is proposed.
[0074] Reference Figure 2 , Figure 2 1 is a flow chart of a first exemplary embodiment of a method for monitoring an animal. The method for monitoring an animal comprises:
[0075] Step S110, obtaining a video stream from a city surveillance camera;
[0076] Specifically, with the help of various network cameras used for daily security monitoring in the city, video streams are pulled from these cameras through the network. Usually, network cameras support multi-channel pulling of video streams, so this method will not interfere with the existing monitoring system.
[0077] Step S120, decoding the video stream to obtain video image frames;
[0078] Specifically, the acquired video stream is decoded using existing video decoding technology to obtain a number of video image frames.
[0079] Step S130: inputting the video image frame into a pre-obtained deep neural network inference module to obtain a plurality of objects in the video image frame and positioning frames of the plurality of objects;
[0080] Specifically, the deep neural network inference module is used to identify people and animals. For animals, the animal category can be identified through existing image recognition methods. The positioning frame is a (x, y, w, h) position description frame composed of the center point coordinates x, y and the width and height w, h of the frame.
[0081] Step S140: identifying stray wild animal targets among the plurality of targets, saving the stray wild animal targets and related information to a database and displaying them.
[0082] Specifically, if the target is identified as an animal target, the animal target is input into a preset feature extraction neural network inference module to extract the features of the animal target; based on the features of the animal target, it is determined whether the animal target is a cat or a dog; if the animal target is a cat or a dog, it is determined whether the animal target is a stray wild animal target; the relevant information of the animal target is saved in a database and displayed.
[0083] This embodiment, through the above-mentioned solution, specifically acquires video streams from city surveillance cameras; decodes the video streams to generate video image frames; inputs the video image frames into a pre-established deep neural network inference module to obtain multiple targets and their location frames within the video image frames; identifies stray wild animal targets within the multiple targets, and stores and displays the stray wild animal targets and related information in a database. This solution enables the identification and monitoring of urban animals through city cameras, achieving comprehensive and low-cost monitoring of urban animals.
[0084] Further, refer to Figure 3 , Figure 3 The flowchart of the second exemplary embodiment of the animal monitoring method is as follows. The steps of identifying stray wild animal targets among the plurality of targets, storing the stray wild animal targets and related information in a database, and displaying the same include:
[0085] Step S1401: If the target is identified as an animal target, the animal target is input into a preset feature extraction neural network inference module to extract features of the animal target;
[0086] Specifically, the targets identified include pedestrians and animals, including cats, dogs, and other mammals. Images of several animal targets are fed into a pre-set feature extraction neural network inference module, which extracts features from each animal target into a 128-dimensional feature vector. Each extracted 128-dimensional feature vector is then used as the basis for monitoring and tracking each animal target.
[0087] Step S1402, judging whether the animal target is a cat or a dog based on the characteristics of the animal target;
[0088] Step S1403: If the animal target is not a cat or a dog, it is determined that the animal target is a stray wild animal target;
[0089] Step S1404: save the relevant information of the animal target to a database and display it.
[0090] Specifically, if it is determined to be a stray wild animal, the time and location of the animal's appearance and the characteristics of the animal target are stored in a database so as to monitor the animal target over a long period of time.
[0091] This embodiment utilizes the above-described scheme. Specifically, if an animal is identified, the target is fed into a preset feature extraction neural network inference module to extract its features. Based on the features, the system determines whether the target is a cat or dog. If not, the target is determined to be a stray wild animal. The relevant information about the target is stored and displayed in a database. This scheme enables the identification of stray wild animals that are not cats or dogs, and their storage in a database, enabling comprehensive and continuous monitoring and tracking of stray wild animals in cities.
[0092] Further, refer to Figure 4 , Figure 4 This is a flow chart of a third exemplary embodiment of the animal monitoring method. After determining whether the animal target is a cat or a dog based on the characteristics of the animal target, and before storing and displaying the relevant information of the animal target in a database, the method further includes:
[0093] Step S14031: If the animal target is a cat or a dog, determine whether the animal target is a stray wild animal target.
[0094] Specifically, if the animal is a cat or dog, it could be a domestic pet or a stray animal. In step S140311, if the animal target is a cat or dog, a determination is made as to whether a pedestrian is present among the multiple targets. In step S140312, if a pedestrian is present, the trajectory of the pedestrian and the animal are matched using a target tracking algorithm. In step S140313, if the trajectory match is successful, monitoring ends. In step S140314, if the trajectory match fails, the animal is determined to be a stray wild animal. This allows determination of whether a cat or dog is supervised. Furthermore, the target tracking algorithm primarily combines a Kalman filter and Hungarian algorithm to associate the target's location frame with the animal's features and match them against the target's features. The Kalman filter uses the x-coordinate and y-coordinate of each target's location frame's center point, the size a of the detection frame, and the aspect ratio r of the detection frame as the four basic states of the target. Pedestrians can be tracked using a Kalman filter algorithm, similar in implementation to the DeepSort target tracking algorithm. However, for animal targets, the aspect ratio r cannot be assumed to remain constant, as it does for human tracking. This aspect ratio r can vary significantly depending on the animal's orientation, movement, and other factors, leading to even greater changes in the target size. Therefore, in this invention, for each animal target, the Kalman filter is described as the following vector:
[0095] X=[x, y, a, r, x′, y′, a′, r′]
[0096] In the initial covariance setting, a and r will be given similar weights as the other two parameters, and it will not be assumed that the change of r is smaller than that of the other parameters. The initial covariance can be as follows:
[0097]
[0098] Q=diag([1 1 1 1 0.01 0.01 0.01 0.01]) T
[0099] R = diag([1 1 10 10]) T In the present invention, the target center point coordinate displacement is based on the uniform motion assumption, just like the target tracking algorithm DeepSort.
[0100] Based on this Kalman filter parameter setting, the Hungarian algorithm uses the same target matching process as the SORT algorithm. Target features are compared, primarily by calculating the cosine similarity between two features. A preset matching threshold is used to determine whether two targets are compatible. This matching threshold is an empirical parameter and, in practice, will be determined based on the model's accuracy and actual testing. Based on the results of consecutive frame matching, the target's trajectory within the monitored area over time can be plotted, using the center point of each target's positioning frame as the reference point.
[0101] Then, the trajectory of each animal target that may be a domestic animal is compared with that of each pedestrian target. The trajectory comparison method is mainly to compare the position of the two targets at each time point, a ((x t (a),y t (a)) and the position of pedestrian b (x t (b),y t (b)) The Euclidean distance d between t :
[0102]
[0103] According to the pet breeding management regulations of various cities, pets need to be equipped with leashes, and the length of the leashes is specified. Therefore, from a regulatory perspective, the distance between pets and their owners should always be kept within a threshold, which can be adjusted according to different local policies. t If the number exceeds a preset threshold, the animal is determined not to be a domestic pet under the pedestrian’s control, but rather a stray wild animal.
[0104] The embodiment of the present application uses the above solution, specifically by determining whether the animal target is a stray wild animal if the animal target is a cat or a dog. Based on this solution, stray wild animals can be distinguished when the animal target is a cat or a dog, avoiding urban hazards caused by missing stray animals in monitoring.
[0105] Further, refer to Figure 5 , Figure 5 Flowchart of the fourth exemplary embodiment of the method for monitoring animals. Referring to the third exemplary embodiment, if the animal target is a cat or a dog, then after the step of determining whether there is a pedestrian target among the multiple targets in step S140311, the method further includes:
[0106] Step S140315: If the pedestrian target does not exist, it is determined that the animal target is a stray wild animal target.
[0107] Specifically, the judgment is made based on whether there is a pedestrian target among the targets. If there is no pedestrian target in the picture, there is no possibility that the animal is being pulled by a person, and it is determined to be a stray animal.
[0108] The embodiment of the present application uses the above solution, specifically by determining that the animal target is a stray wild animal target if the pedestrian target is not present. This achieves the goal of distinguishing stray wild animals when the animal target is a cat or dog and there are no pedestrians around, thus avoiding the hidden dangers of missing stray animals in urban monitoring.
[0109] Further, refer to Figure 6 , Figure 6 The flowchart of the fifth exemplary embodiment of the method for monitoring animals is shown in FIG. The steps of storing and displaying the relevant information of the animal target in a database include:
[0110] Step S14041, associating the relevant information of the animal target with the recorded data in the database;
[0111] Specifically, the recorded data in the database includes the characteristics, categories, appearance time, and location of stray wild animal targets that have been tracked and monitored in multiple cities. The animal targets and related information include the characteristics, categories, appearance time, and location of cats or dogs identified as stray wild animal targets. The two are matched to determine whether the currently discovered stray wild animal target has been tracked and monitored before.
[0112] Step S14042: If the association is successful, the features in the recorded data are matched with the features of the animal target.
[0113] Specifically, if the features in the recorded data successfully match the features of the animal target, the recorded data of the successful match is updated; if the features in the recorded data fail to match the features of the animal target, new recorded data of the animal target is created. Based on this solution, the purpose of preserving stray wild animals is achieved.
[0114] Further, refer to Figure 7 , Figure 7 This is a functional flow chart of the sixth exemplary embodiment of the animal monitoring method of this application. The specific process is as follows:
[0115] First, using various network cameras used for daily security monitoring in the city, video streams are pulled from these cameras through the network and the video streams are decoded to obtain video image frames;
[0116] Next, the target detection model is used to detect human or animal targets in the video image frames;
[0117] Next, determine whether there is an animal target. If there is an animal target, perform deep feature extraction on the animal target.
[0118] Next, the extracted depth features are used to determine whether it is a cat or a dog. If it is not a cat or a dog, the category, appearance time, location, depth features, and captured pictures of the identified animal target are uploaded to the database and displayed. If it is a cat or a dog, it is determined whether there are pedestrians at the same time, and the target is tracked for continuous frames to obtain the motion trajectory of the animal target and nearby pedestrians in continuous time, and the trajectories between the targets are matched. If at least one pedestrian is matched and strongly correlated with the running trajectory of the animal target, the process ends. Otherwise, the category, appearance time, location, depth features, and captured pictures of the animal target are uploaded to the server and displayed.
[0119] In addition, an embodiment of the present application further provides an animal monitoring device, the animal monitoring device comprising:
[0120] Acquisition module, used to obtain video streams from city surveillance cameras;
[0121] A decoding module, configured to decode the video stream to obtain video image frames;
[0122] A positioning module, configured to input the video image frame into a pre-obtained deep neural network inference module to obtain a plurality of targets in the video image frame and positioning frames of the plurality of targets;
[0123] The identification module is used to identify stray wild animal targets among the multiple targets, save the stray wild animal targets and related information to a database and display them.
[0124] In addition, an embodiment of the present application also proposes a terminal device, which includes a memory, a processor, and an animal monitoring program stored in the memory and runnable on the processor. When the animal monitoring program is executed by the processor, the steps of the animal monitoring method are implemented.
[0125] Since the animal monitoring program adopts all the technical solutions of all the aforementioned embodiments when executed by the processor, it has at least all the beneficial effects brought by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.
[0126] In addition, an embodiment of the present application further provides a readable storage medium, on which a program is stored. When the animal monitoring program is executed by a processor, the steps of the animal monitoring method described above are implemented.
[0127] Since the animal monitoring program adopts all the technical solutions of all the aforementioned embodiments when executed by the processor, it has at least all the beneficial effects brought by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.
[0128] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.
[0129] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0130] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as mentioned above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the method of each embodiment of the present application.
[0131] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for monitoring an animal, characterized in that: The animal monitoring method comprises the following steps: Get video streams from city surveillance cameras; Decoding the video stream to obtain video image frames; Inputting the video image frame into a pre-obtained deep neural network inference module to obtain a plurality of targets in the video image frame and positioning frames of the plurality of targets; Identifying stray wild animal targets among the multiple targets, saving the stray wild animal targets and related information to a database and displaying them, specifically including: If an animal target is identified among the multiple targets, the animal target is input into a preset feature extraction neural network inference module to extract features of the animal target; based on the features of the animal target, it is determined whether the animal target is a cat or a dog; if the animal target is not a cat or a dog, it is determined that the animal target is a stray wild animal target; If the animal target is a cat or a dog, determining whether the animal target is a stray wild animal target specifically includes: If the animal target is a cat or a dog, determining whether there is a pedestrian target among the multiple targets; if there is a pedestrian target, matching the running trajectory of the pedestrian target with the animal target according to a target tracking algorithm, specifically including: Through the Kalman filter algorithm, the horizontal coordinate, vertical coordinate, detection frame size, and detection frame aspect ratio of the center point of the positioning frame of each target are used as the four basic states of the target; wherein, in the setting of the initial covariance of the animal target, the detection frame size and the detection frame aspect ratio are given weights similar to the changes in the horizontal coordinate and the vertical coordinate; based on the basic state of the target, a feature vector for describing the positioning frame state is generated, and the feature vector includes an animal vector and a pedestrian vector; the cosine similarity of the animal vector and the pedestrian vector is calculated, and the first human target matching the animal target is obtained by threshold matching the cosine similarity of the animal vector and the pedestrian vector; with the center point of the positioning frame of each target as the reference point, a first motion trajectory of the animal target and a second motion trajectory of the first human target corresponding to the animal target are drawn, and the first motion trajectory is track-matched with the second motion trajectory; If the running trajectory is matched successfully, the monitoring ends; If the running trajectory fails to match, it is determined that the animal target is a stray wild animal target.
2. The animal monitoring method according to claim 1, characterized in that: If the animal target is not a cat or a dog, then the step of determining that the animal target is a stray wild animal target includes: The relevant information of the animal target is saved in a database and displayed.
3. The animal monitoring method according to claim 1, characterized in that: If the animal target is a cat or a dog, then after the step of determining whether there is a pedestrian target among the multiple targets, the method further includes: If the pedestrian target does not exist, it is determined that the animal target is a stray wild animal target.
4. The animal monitoring method according to claim 2, characterized in that: The step of storing and displaying the relevant information of the animal target in a database includes: Associating the relevant information of the animal target with the recorded data in the database; If the association is successful, the features in the recorded data are matched with the features of the animal target.
5. The animal monitoring method according to claim 4, characterized in that: If the association is successful, the step of matching the features in the recorded data with the features of the animal target includes: If the features in the recorded data successfully match the features of the animal target, updating the successfully matched recorded data; If the features in the recorded data fail to match the features of the animal target, new recorded data of the animal target is created.
6. An animal monitoring device, characterized in that: The animal monitoring device comprises: Acquisition module, used to obtain video streams from city surveillance cameras; A decoding module, configured to decode the video stream to obtain video image frames; A positioning module, configured to input the video image frame into a pre-obtained deep neural network inference module to obtain a plurality of targets in the video image frame and positioning frames of the plurality of targets; The identification module is used to identify stray wild animal targets among the multiple targets, save the stray wild animal targets and related information to the database and display them, specifically including: If an animal target is identified among the multiple targets, the animal target is input into a preset feature extraction neural network inference module to extract features of the animal target; based on the features of the animal target, it is determined whether the animal target is a cat or a dog; if the animal target is not a cat or a dog, it is determined that the animal target is a stray wild animal target; If the animal target is a cat or a dog, determining whether the animal target is a stray wild animal target specifically includes: If the animal target is a cat or a dog, determining whether there is a pedestrian target among the multiple targets; if there is a pedestrian target, matching the running trajectory of the pedestrian target with the animal target according to a target tracking algorithm, specifically including: Through the Kalman filter algorithm, the horizontal coordinate, vertical coordinate, detection frame size, and detection frame aspect ratio of the center point of the positioning frame of each target are used as the four basic states of the target; wherein, in the setting of the initial covariance of the animal target, the detection frame size and the detection frame aspect ratio are given weights similar to the changes in the horizontal coordinate and the vertical coordinate; based on the basic state of the target, a feature vector for describing the positioning frame state is generated, and the feature vector includes an animal vector and a pedestrian vector; the cosine similarity of the animal vector and the pedestrian vector is calculated, and the first human target matching the animal target is obtained by threshold matching the cosine similarity of the animal vector and the pedestrian vector; with the center point of the positioning frame of each target as the reference point, a first motion trajectory of the animal target and a second motion trajectory of the first human target corresponding to the animal target are drawn, and the first motion trajectory is track-matched with the second motion trajectory; If the running trajectory is matched successfully, the monitoring ends; If the running trajectory fails to match, it is determined that the animal target is a stray wild animal target.
7. A terminal device, characterized in that: The terminal device includes a memory, a processor, and an animal monitoring program stored in the memory and executable on the processor. When the animal monitoring program is executed by the processor, the steps of the animal monitoring method according to any one of claims 1 to 5 are implemented.
8. A storage medium, characterized in that: The storage medium stores an animal monitoring program, and when the animal monitoring program is executed by the processor, the steps of the animal monitoring method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Animal monitoring method and device
CN112989892A