A method for identifying animal circling behavior
By obtaining the center of mass movement trajectory of the animal and using the sliding window algorithm for elliptical fitting, the problem of difficult positioning of the animal's circle behavior during the time period is solved, and the recognition accuracy and reliability are improved.
Patent Information
- Application Number
- CN202411075857.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-07
AI Technical Summary
The prior art is difficult to accurately locate the time period of animal circle behavior, resulting in inaccurate identification.
By obtaining the center of mass movement trajectory of the animal, the sliding window algorithm is used to ellipse fit the center of mass scattered points to determine the target ellipse parameters, thereby determining the animal's circle behavior information based on these parameters.
Accurate positioning of the time period of animal circle behavior is achieved, and recognition accuracy and reliability are improved.
Smart Images

Figure CN118587778B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of animal behavior recognition, and in particular to a method for recognizing animal circling behavior. Background Art
[0002] The purpose of captive breeding is to provide animals with a suitable living environment for stable growth and development. However, when animals are constantly in a certain environment, their nature in nature gradually disappears or cannot be fully expressed, and some abnormal behaviors, so-called stereotyped behaviors, will appear. Stereotyped behaviors are manifested as repeated actions, such as shaking the head, pacing back and forth, etc. Stereotyped behaviors directly affect the health of animals, leading to behavioral degradation, loss of certain functions, growth retardation and decreased fertility. In addition, in some pharmacological studies with animals as experimental subjects, such as the study of major depressive disorder (MDD) in monkeys, stereotyped behaviors are closely related to stress, anxiety and depression, and are the main determining behaviors of the disease. Identifying and analyzing stereotyped behaviors can help examine the physiological and mental health of animals, so as to make corresponding improvement measures in advance, and it is also conducive to the research of pharmacology and brain science. The circling behavior belongs to the stereotyped behavior of pacing back and forth.
[0003] At present, some researchers use image processing methods to extract the foreground of animals in images, calculate the position of the animal's head and body, and determine the number of circles it has turned by calculating the angle of the animal's body. However, although such methods can accurately analyze the animal's circling behavior, they are greatly affected by other behaviors and it is difficult to accurately locate the time period of the circling behavior. How to objectively and accurately identify and analyze the circling behavior of animals has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The purpose of the present invention is to solve the problem that it is difficult to locate the time period of animal circling behavior, resulting in the inability to accurately identify its circling behavior. The present invention provides a method for identifying animal circling behavior.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] A first aspect of an embodiment of the present application provides a method for identifying animal circling behavior, comprising:
[0007] Obtaining a mass center movement trajectory of a target object; the mass center movement trajectory includes a plurality of mass center scattered points;
[0008] Using a sliding window algorithm to perform ellipse fitting on the centroid scattered points to determine target ellipse parameters;
[0009] The circling behavior information of the target object is determined based on the target ellipse parameters.
[0010] Optionally, obtaining the mass center movement trajectory of the target object includes:
[0011] Obtain monitoring video containing the target object;
[0012] Determining the centroid position of the target object based on the position of the preset marking point on the target object;
[0013] Based on the centroid position of the target object in each frame image of the monitoring video and the time sequence corresponding to the image, the centroid movement trajectory of the target object is determined.
[0014] Optionally, performing ellipse fitting on the centroid scattered points using a sliding window algorithm to determine target ellipse parameters includes:
[0015] Acquire the first ellipse fitting parameters of the centroid scatter points under the first window; the first window is not less than the time length of the target object turning around once; the first ellipse fitting parameters include ellipse shape parameters, ellipse closure and extreme distance;
[0016] When the first ellipse fitting parameters meet preset requirements, move the first window to traverse the centroid scatter points to obtain second ellipse fitting parameters;
[0017] Target ellipse parameters are determined based on the first ellipse fitting parameters and the second ellipse fitting parameters.
[0018] Optionally, also include:
[0019] When all the ellipse fitting parameters of the centroid scatter points under the first window meet the preset requirements, the first window is enlarged to obtain a second window; the second window is the maximum window when the ellipse fitting parameters meet the preset requirements;
[0020] The second window is used to traverse the centroid scattered points to obtain target ellipse parameters.
[0021] Optionally, the performing ellipse fitting on the centroid scattered points using a sliding window algorithm to determine target ellipse parameters further includes:
[0022] Obtaining fitting error values of the target ellipse parameters;
[0023] Adjusting and optimizing the target ellipse parameters based on the fitting error value until a minimum fitting error value is obtained;
[0024] The target ellipse parameters corresponding to the minimum fitting error value are determined as the final target ellipse parameters.
[0025] Optionally, before performing ellipse fitting on the centroid scattered points using a sliding window algorithm to determine target ellipse parameters, the method includes:
[0026] The centroid movement trajectory is filtered to remove abnormal centroid scattered points in the centroid movement trajectory.
[0027] Optionally, the determining the circling behavior information of the target object based on the target ellipse parameters includes:
[0028] Based on the Euclidean distance between the position of each centroid scatter point in the target ellipse parameter and the corresponding initial position, obtaining a distance change curve;
[0029] The number of circles and the period of circles of the target object are determined based on the waveform of the distance variation curve.
[0030] A second aspect of the embodiment of the present application provides an animal circling behavior recognition device, comprising: an acquisition module, a fitting module and a determination module, wherein:
[0031] The acquisition module is configured to acquire a mass center movement trajectory of the target object; the mass center movement trajectory includes a plurality of mass center scattered points;
[0032] The fitting module is configured to perform ellipse fitting on the centroid scattered points using a sliding window algorithm to determine target ellipse parameters;
[0033] The determination module is configured to determine the circling behavior information of the target object based on the target ellipse parameters.
[0034] A third aspect of an embodiment of the present application provides an electronic device, including a processor and a memory; the memory stores a computer program, wherein the computer program, when executed by the processor, implements the animal circling behavior recognition method described in the first aspect.
[0035] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.
[0036] Compared with the prior art, the technical solution provided by this application has the following beneficial effects:
[0037] The present invention provides a method for identifying animal circling behavior. The method obtains the moving trajectory of the center of mass of a target object, performs ellipse fitting on the center of mass scatter points using a sliding window algorithm, determines the target ellipse parameters, and determines the circling behavior information of the target object based on the target ellipse parameters. This achieves accurate positioning of the circling behavior time period, thereby improving the recognition accuracy and reliability of the animal circling behavior. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1A schematic diagram of a process for identifying animal circling behavior provided in an embodiment of the present application;
[0039] Figure 2 A schematic diagram of the structure of a device for identifying animal circling behavior provided in an embodiment of the present application;
[0040] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] Below, embodiments of the present application will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present application. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present application. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present application.
[0042] The terms used herein are only for describing specific embodiments and are not intended to limit the present application. The terms "include", "comprising", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0043] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0044] Some block diagrams and / or flow charts are shown in the accompanying drawings. It should be understood that some blocks or combinations thereof in the block diagrams and / or flow charts may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that these instructions, when executed by the processor, may create a device for implementing the functions / operations described in these block diagrams and / or flow charts.
[0045] In some embodiments, see Figure 1 , Figure 1 A schematic diagram of a flow chart of a method for identifying animal circling behavior provided in an embodiment of the present application; a method for identifying animal circling behavior provided in an embodiment of the present application includes:
[0046] S110, obtaining a centroid movement trajectory of the target object; the centroid movement trajectory includes a plurality of centroid scattered points.
[0047] When the target object is turning in circles, the position of its center of mass changes over time. By connecting the positions of multiple center of mass scattered points in consecutive video frames in time order, the center of mass moving trajectory of the target object can be obtained. Here, the position of the center of mass scattered points can be obtained from the video frames through the trained detection model.
[0048] S120, performing ellipse fitting on the centroid scattered points using a sliding window algorithm to determine target ellipse parameters.
[0049] In this embodiment, the target ellipse parameters are determined by combining the sliding window algorithm and the ellipse fitting algorithm. Specifically, the size of the sliding window is predetermined, that is, the number of centroid scatter points to be fitted to the ellipse each time. Here, the sliding window is a time window, that is, it represents a time period. The ellipse fitting algorithm is applied to the centroid scatter points in the sliding window to perform ellipse fitting to obtain the initial ellipse parameters. Exemplarily, the ellipse fitting algorithm can be the least squares method, the direct fitting method (such as algebraic fitting or geometric fitting), etc. After completing the initial fitting, the sliding window is moved forward by the distance of one or more centroid scatter points (the time interval corresponding to one or more video frames), and the above steps are repeated until the sliding window traverses all the centroid scatter points, thereby determining the target ellipse parameters (such as the center, major axis, minor axis and rotation angle).
[0050] S130, determining the circling behavior information of the target object based on the target ellipse parameters.
[0051] Here, the circling behavior information of the target object may include information such as the number of circles, the circling period, etc. The target ellipse parameter may also include an ellipse shape, and the circling path of the target object may be determined according to the ellipse shape.
[0052] In some embodiments, S110, obtaining the mass center movement trajectory of the target object includes:
[0053] Obtain monitoring video containing the target object;
[0054] Determine the centroid position of the target object based on the position of the preset marking point on the target object;
[0055] Based on the centroid position of the target object in each frame of the monitoring video and the time sequence corresponding to the image, the centroid movement trajectory of the target object is determined.
[0056] In this embodiment, the target object may be a living being such as a mouse, a monkey, or a rabbit that needs to be monitored. Specifically, a monitoring video containing the target object may be obtained through a camera device corresponding to the monitoring area. There may be multiple cameras, each located at a different position of the target object, so that the specific condition of the target object can be more comprehensively reflected and a more accurate particle position can be obtained. By splitting the monitoring video into multiple video frames, and obtaining the particle position of the target object in each video frame, combined with the time sequence of the video frames, the movement trajectory of the center of mass of the target object can be determined. It should be noted that the method for obtaining the center of mass trajectory may specifically adopt a deep learning method, and other image processing methods may also be used, such as background subtraction method, edge detection method, etc. For the marker point information, the average coordinates of all marker points are calculated and regarded as the center of mass point; if the marker point is in the form of a rectangular frame, then for the rectangular frame information, the center of the rectangular frame may be regarded as the center of mass.
[0057] In some embodiments, S120, performing ellipse fitting on the centroid scattered points using a sliding window algorithm to determine target ellipse parameters includes:
[0058] Obtain the first ellipse fitting parameters of the centroid scatter points under the first window; the first window is not less than the time length of the target object turning around once; the first ellipse fitting parameters include ellipse shape parameters, ellipse closure and extreme value distance;
[0059] When the first ellipse fitting parameters meet the preset requirements, the first window is moved to traverse the centroid scatter points to obtain the second ellipse fitting parameters;
[0060] The target ellipse parameters are determined based on the first ellipse fitting parameters and the second ellipse fitting parameters.
[0061] The first ellipse fitting parameters and the second ellipse fitting parameters include the same parameter types, such as ellipse shape parameters, ellipse closure and extreme distance parameters. The logic of the actual circling path of the target object can be determined based on the ellipse shape parameters, whether the centroid scatter point set forms a closed ellipse can be determined based on the ellipse closure parameters, and the fitting accuracy can be determined based on the extreme distance parameters. Only when the ellipse shape parameters, ellipse closure and extreme distance all meet the preset requirements, the first window can be determined as the circling behavior time period.
[0062] In one example, judging whether the first ellipse fitting parameters meet the preset requirements includes judging the closure of the ellipse. The closure of the ellipse is to divide the ellipse into multiple sectors with the center of the ellipse as the origin, and the number of sectors depends on the situation. Then, the number of centroid scatter points in each sector is calculated to determine whether the number of centroid scatter points in each sector meets the requirements. If the requirements are met, it is considered that the centroid scatter points are continuous in this sector. If the number of sectors finally filled is greater than the set minimum number of continuous sectors, it is considered that the number of centroid scatter points forms a closed ellipse.
[0063] In another example, judging whether the first ellipse fitting parameters meet the preset requirements includes judging the rationality of the parameters. The shape of the fitted ellipse should conform to the actual motion trajectory, and the center position, the length of the major axis and the minor axis should be within a reasonable range.
[0064] In another example, judging whether the first ellipse fitting parameter meets the preset requirements includes judging the maximum distance. An optimization algorithm is used to calculate the shortest distance from each centroid scatter point to the ellipse trajectory. If the shortest distance of a certain point is greater than a threshold, it is considered that the centroid scatter point does not conform to the circling trajectory.
[0065] It should be noted that in addition to the above judgment conditions, there may be other conditions, such as velocity vector judgment (used to distinguish the moments when the animal is stationary and moving in the opposite direction), which can be used to judge circling behavior, and they are not enumerated here.
[0066] In this embodiment, the length of time for the target object to circle once can be determined as the first window, and the first window is traversed and moved with a certain step length, thereby obtaining multiple ellipse fitting parameters under the first window, including the first ellipse fitting parameters and the second ellipse fitting parameters. The step length can be the distance between one or more centroid scatter points (the time interval corresponding to one or more video frames). It should be noted that the first window at the initial moment should not be too large to avoid too many abnormal centroid scatter points.
[0067] In some embodiments, it also includes:
[0068] When all the ellipse fitting parameters of the centroid scatter points under the first window meet the preset requirements, the first window is enlarged to obtain the second window; the second window is the maximum window when the ellipse fitting parameters meet the preset requirements;
[0069] Use the second window to traverse the centroid scatter points and obtain the target ellipse parameters.
[0070] In this embodiment, when all the centroid scattered points in the first window meet the preset requirements, the starting point and the end point of the first window can be expanded outward, and the size of the first window can be increased until the scattered points in the first window do not meet the judgment requirements. At this time, the critical window that meets the preset conditions is determined as the second window, and the second window is a complete period of circling behavior. Subsequently, the size of the second window is reset to the default, and the starting point is the end point of the previous window. The above process is repeated until all the centroid scattered points are traversed and the target ellipse parameters are obtained.
[0071] In some embodiments, S120, using a sliding window algorithm to perform ellipse fitting on the centroid scattered points to determine the target ellipse parameters, further includes:
[0072] Get the fitting error value of the target ellipse parameters;
[0073] The target ellipse parameters are adjusted and optimized based on the fitting error value until the minimum fitting error value is obtained;
[0074] The target ellipse parameters corresponding to the minimum fitting error value are determined as the final target ellipse parameters.
[0075] In this embodiment, the target ellipse parameters are continuously adjusted to reduce the deviation between the actual centroid scatter points and the theoretical ellipse trajectory to achieve the best fit. In each iteration, the residual under the current parameters can be calculated, and then the target ellipse parameters can be updated according to the gradient information of the residual to gradually approach the minimum residual solution. Taking the least squares method as an example, its goal is to minimize the sum of squares of all centroid scatter residuals. Assume that the equation of the ellipse is:
[0076] ;
[0077] in is the coordinate of the center of the ellipse, a is the length of the major axis of the ellipse, b is the length of the minor axis of the ellipse, and θ is the rotation angle of the ellipse. A positive value indicates a counterclockwise rotation. In order to calculate the residual, we first need to rotate the centroid scatter points to the coordinate system of the ellipse. The rotated coordinates are It is given by the following formula:
[0078] ;
[0079] For each rotated centroid scatter point, calculate its residual relative to the standard ellipse equation. The residual calculation formula is given by the following formula:
[0080] ;
[0081] The square of the residual is the quantity that needs to be minimized in the optimization process. In the least squares fitting process, these residuals will be used to adjust the ellipse parameters so that the sum of these residuals is as small as possible, thereby finding the best target ellipse parameters. It should be noted that in addition to using the least squares method to update the target ellipse parameters, the steepest descent method, Newton method, Gauss-Newton method, etc. can also be used. They can be flexibly selected according to needs and are not limited to this.
[0082] In some embodiments, at S120, before performing ellipse fitting on the centroid scattered points using a sliding window algorithm and determining the target ellipse parameters, the animal circling behavior recognition method includes:
[0083] The centroid moving trajectory is filtered to remove abnormal centroid scattered points in the centroid moving trajectory.
[0084] In this embodiment, taking into account the centroid calculation error and the position mutation that does not conform to the law of animal movement, the centroid moving trajectory is filtered to remove abnormal centroid scatter points in the centroid moving trajectory. Exemplarily, a Kalman filter can be used for optimization processing. By modifying and determining the parameters of the state noise Q and observation noise R of a suitable filter, the mutation points in the centroid trajectory are smoothed. The result of the Kalman filter prediction is used as the current frame prediction value to complete the filtering of the centroid moving trajectory. It should be noted that in addition to using Kalman filtering, other filtering methods, such as median filtering, adaptive filtering, etc., can also be used, without limitation.
[0085] In some embodiments, S130, determining the circling behavior information of the target object based on the target ellipse parameters includes:
[0086] Based on the Euclidean distance between the position of each centroid scatter point in the target ellipse parameter and the corresponding initial position, a distance change curve is obtained;
[0087] The number of circles and the circle period of the target object are determined based on the waveform of the distance change curve.
[0088] In this embodiment, the Euclidean distance between the centroid of each frame and the centroid of the initial frame is calculated as the basis for the position change in the entire behavior, and a distance change curve is created. Based on this, the target object's circle period, number of circles, and other information can be obtained by analyzing the waveform of the distance change curve. For example, the number of circles can be obtained by analyzing the number of peaks of the waveform, and the circle period can be obtained by the interval between the peaks.
[0089] The embodiment of the present application obtains the moving trajectory of the center of mass of the target object, and then uses a sliding window algorithm to perform ellipse fitting on the center of mass scatter points to determine the target ellipse parameters. Based on the target ellipse parameters, the circling behavior information of the target object is determined, thereby achieving precise positioning of the circling behavior time period, thereby improving the recognition accuracy and reliability of the animal's circling behavior.
[0090] In some embodiments, see Figure 2 , Figure 2 The structure diagram of an animal circling behavior recognition device provided in an embodiment of the present application. The animal circling behavior recognition device 200 provided in an embodiment of the present application includes: an acquisition module 210, a fitting module 220 and a determination module 230, wherein:
[0091] An acquisition module 210 is configured to acquire a mass center movement trajectory of a target object; the mass center movement trajectory includes a plurality of mass center scattered points;
[0092] A fitting module 210 is configured to perform ellipse fitting on the centroid scattered points using a sliding window algorithm to determine target ellipse parameters;
[0093] The determination module 210 is configured to determine the circling behavior information of the target object based on the target ellipse parameters.
[0094] In some embodiments, the acquisition module 210 is specifically configured as follows:
[0095] Obtain monitoring video containing the target object;
[0096] Determine the centroid position of the target object based on the position of the preset marking point on the target object;
[0097] Based on the centroid position of the target object in each frame of the monitoring video and the time sequence corresponding to the image, the centroid movement trajectory of the target object is determined.
[0098] In some embodiments, the fitting module 220 is specifically configured as follows:
[0099] Obtain the first ellipse fitting parameters of the centroid scatter points under the first window; the first window is not less than the time length of the target object turning around once; the first ellipse fitting parameters include ellipse shape parameters, ellipse closure and extreme value distance;
[0100] When the first ellipse fitting parameters meet the preset requirements, the first window is moved to traverse the centroid scatter points to obtain the second ellipse fitting parameters;
[0101] The target ellipse parameters are determined based on the first ellipse fitting parameters and the second ellipse fitting parameters.
[0102] In some embodiments, the fitting module 220 is further configured to:
[0103] When all the ellipse fitting parameters of the centroid scatter points under the first window meet the preset requirements, the first window is enlarged to obtain the second window; the second window is the maximum window when the ellipse fitting parameters meet the preset requirements;
[0104] Use the second window to traverse the centroid scatter points and obtain the target ellipse parameters.
[0105] In some embodiments, the fitting module 220 is further configured to:
[0106] Get the fitting error value of the target ellipse parameters;
[0107] The target ellipse parameters are adjusted and optimized based on the fitting error value until the minimum fitting error value is obtained;
[0108] The target ellipse parameters corresponding to the minimum fitting error value are determined as the final target ellipse parameters.
[0109] In some embodiments, the animal circling behavior recognition device 200 further includes a filtering module, and the filtering module is specifically configured as follows:
[0110] The centroid moving trajectory is filtered to remove abnormal centroid scattered points in the centroid moving trajectory.
[0111] In some embodiments, the determination module 230 is specifically configured as follows:
[0112] Based on the Euclidean distance between the position of each centroid scatter point in the target ellipse parameter and the corresponding initial position, a distance change curve is obtained;
[0113] The number of circles and the circle period of the target object are determined based on the waveform of the distance change curve.
[0114] The animal circling behavior recognition device provided in the embodiment of the present application can implement each process in the embodiment corresponding to the above-mentioned animal circling behavior recognition method, and will not be described again here to avoid repetition.
[0115] It should be noted that the animal circling behavior recognition device provided in the embodiment of the present application and the animal circling behavior recognition method provided in the embodiment of the present application are based on the same application concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned animal circling behavior recognition method, and the repeated parts will not be repeated.
[0116] In some embodiments, see Figure 3 , Figure 3 The electronic device 300 provided in the embodiment of the present application includes a processor 310 and a memory 320; the memory 320 stores a computer program, wherein the computer program implements the above-mentioned animal circling behavior recognition method when executed by the processor.
[0117] Specifically, the processor 310 may include, for example, a general-purpose microprocessor, an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 310 may also include an onboard memory for cache purposes. The processor 310 may be a single processing unit or multiple processing units for executing different actions of the method flow according to the embodiment of the present application.
[0118] The memory 320 may be any medium capable of containing, storing, conveying, propagating or transmitting instructions. For example, the memory 320 may include, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device, component or propagation medium. Specific examples of the memory 320 include: a magnetic storage device, such as a magnetic tape or a hard disk (HDD); an optical storage device, such as a compact disk (CD-ROM); a random access memory (RAM) or a flash memory; and / or a wired / wireless communication link.
[0119] The present application also provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned animal circling behavior recognition method is implemented. The computer-readable medium may be included in the device / apparatus / system described in the above-mentioned embodiment; or it may exist independently without being assembled into the device / apparatus / system. The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed, the method according to the embodiment of the present application is implemented.
[0120] According to an embodiment of the present application, a computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, optical cable, radio frequency signal, etc., or any suitable combination of the above.
[0121] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims of the present application may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present application. In particular, without departing from the spirit and teachings of the present application, the features described in the various embodiments and / or claims of the present application may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present application. Therefore, the scope of the present application should not be limited to the above-described embodiments, but should be determined not only by the appended claims, but also by the equivalents of the appended claims.
Claims
1. A method for identifying animal circling behavior, characterized in that: include: Obtain the center of mass movement trajectory of the target object; The centroid movement trajectory includes a plurality of centroid scattered points; Obtaining first ellipse fitting parameters of the centroid scatter points under a first window; the first window is not less than the time length of a circle of the target object; The first ellipse fitting parameters include ellipse shape parameters, ellipse closure and extreme distance; when the first ellipse fitting parameters meet preset requirements, the first window is moved to traverse the centroid scatter points to obtain second ellipse fitting parameters; When the first ellipse fitting parameters and the second ellipse fitting parameters of the centroid scatter points under the first window both meet preset requirements, enlarging the first window to obtain a second window; The second window is the maximum window when the ellipse fitting parameters meet the preset requirements; Traversing the centroid scattered points with the second window to obtain target ellipse parameters; Based on the Euclidean distance between the position of each centroid scatter point in the target ellipse parameter and the corresponding initial position, obtaining a distance change curve; The number of circles and the period of circles of the target object are determined based on the waveform of the distance variation curve.
2. The method for identifying animal circling behavior according to claim 1, characterized in that: The step of obtaining the center of mass movement trajectory of the target object includes: Obtain monitoring video containing the target object; Determine the centroid position of the target object based on the position of the preset marking point on the target object; Based on the centroid position of the target object in each frame image of the monitoring video and the time sequence corresponding to the image, the centroid movement trajectory of the target object is determined.
3. The method for identifying animal circling behavior according to claim 1, characterized in that: The step of traversing the centroid scattered points with the second window to obtain target ellipse parameters also includes: Obtaining fitting error values of the target ellipse parameters; Adjusting and optimizing the target ellipse parameters based on the fitting error value until a minimum fitting error value is obtained; The target ellipse parameters corresponding to the minimum fitting error value are determined as the final target ellipse parameters.
4. The method for identifying animal circling behavior according to claim 1, characterized in that: Before obtaining the first ellipse fitting parameters of the centroid scatter points under the first window, the method includes: The centroid movement trajectory is filtered to remove abnormal centroid scattered points in the centroid movement trajectory.
5. A device for identifying animal circling behavior, characterized in that: include: Acquisition module, fitting module and determination module, wherein, The acquisition module is configured to acquire a mass center movement trajectory of the target object; the mass center movement trajectory includes a plurality of mass center scattered points; The fitting module is configured to obtain the first ellipse fitting parameters of the centroid scatter points under the first window; the first window is not less than the time length of the target object turning around once; the first ellipse fitting parameters include ellipse shape parameters, ellipse closure and extreme distance; when the first ellipse fitting parameters meet the preset requirements, move the first window to traverse the centroid scatter points to obtain the second ellipse fitting parameters; when the first ellipse fitting parameters and the second ellipse fitting parameters of the centroid scatter points under the first window both meet the preset requirements, enlarge the first window to obtain the second window; the second window is the maximum window when the ellipse fitting parameters meet the preset requirements; traverse the centroid scatter points with the second window to obtain the target ellipse parameters; The determination module is configured to obtain a distance change curve based on the Euclidean distance between the position of each centroid scatter point in the target ellipse parameter and the corresponding initial position; and determine the number of circles and the circle period of the target object based on the waveform of the distance change curve.
6. An electronic device comprising a processor and a memory; the memory stores a computer program, wherein: When the computer program is executed by the processor, the computer program implements the animal circling behavior recognition method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
