A method, device and electronic equipment for detecting lost pets
By constructing a set of pet owners and tracking pedestrians around the target pet, the problem of high complexity in detecting pet owners in existing technologies is solved, and fast and accurate pet loss detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHIDAO NETWORK TECH (BEIJING) CO LTD
- Filing Date
- 2023-04-28
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies require detecting the pet owner when detecting lost pets, resulting in high computational resource consumption and high detection complexity, making it difficult to quickly and accurately determine whether a pet is lost.
By acquiring pedestrian tracking results when the target pet first appears, a set of pet owners is constructed. Pedestrians around the target pet are continuously tracked to determine whether a pet owner exists within a preset time. This avoids directly detecting the pet owner and uses a simple target matching algorithm to determine whether the pet is lost.
It enables rapid and accurate detection of lost pets, reduces reliance on pet owners for detection, and improves detection efficiency and accuracy.
Smart Images

Figure CN116486110B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing technology, and in particular to a method, device and electronic device for detecting lost pets. Background Technology
[0002] Pets, as companion animals, are a source of happiness and health for humans, and owning pets can make people's lives healthier and more fulfilling. In daily life, people often take their pets for walks or outings, but due to lack of attention or unfamiliarity with using leashes, the chances of pets getting lost increase.
[0003] Existing technologies for detecting lost pets require first identifying the pet's owner through image recognition technology, and then determining whether the pet is lost based on changes in the distance between the pet and the owner. However, the algorithms for detecting pet owners are often highly complex and consume a lot of computing resources. Summary of the Invention
[0004] This application provides a method, device, and electronic device for detecting lost pets, which can accurately determine whether a pet is lost without detecting the pet owner.
[0005] The embodiments of this application adopt the following technical solutions:
[0006] In a first aspect, embodiments of this application provide a method for detecting lost pets, the method comprising:
[0007] When a target pet is detected for the first time, the pedestrian tracking results of the area where the target pet first appeared are obtained, and the set of pet owners of the target pet is obtained based on the pedestrian tracking results;
[0008] The system continuously acquires the tracking results of pedestrians around the target pet, and determines the relationship between the target pet and the surrounding pedestrians within a preset time period based on the continuously acquired tracking results of pedestrians around each frame and the tracking results of pedestrians in the pet owner set. The relationship includes the absence of a pet owner among the surrounding pedestrians and the presence of a pet owner among the surrounding pedestrians.
[0009] Whether the target pet is lost is determined based on the relationship between the target pet and surrounding pedestrians within a preset time period.
[0010] Optionally, determining the relationship between the target pet and surrounding pedestrians within a preset time period based on the continuously acquired pedestrian tracking results for each frame and the pedestrian tracking results in the pet owner set includes:
[0011] The continuously acquired pedestrian tracking results for each frame are matched with the pedestrian tracking results in the pet owner set to obtain the target matching results for each frame within a set time period.
[0012] The relationship between the target pet and the surrounding pedestrians is determined based on the target matching results of each frame within a set time period.
[0013] Optionally, the step of continuously acquiring the surrounding pedestrian tracking results for each frame and performing target matching with the pedestrian tracking results in the pet owner set to obtain the target matching results for each frame within a set time period includes:
[0014] Determine whether the current time period meets the set expansion condition based on the target matching results of each frame within the current time period;
[0015] When the set expansion condition is met in the current time period, the pet owner set is expanded according to the pedestrian tracking target in the area where the target pet is located in the current time period. The surrounding pedestrian tracking results of each subsequent frame are matched with the pedestrian tracking target in the expanded pet owner set. The target matching result of each frame in the current time period and the target matching result of each subsequent frame are obtained.
[0016] If the set expansion condition is not met in the current time period, the target matching result of each frame in the set time period is obtained based on the target matching result between the surrounding pedestrian tracking result of each frame in the set time period and the pedestrian tracking target in the pet owner set.
[0017] Optionally, determining whether the current time period meets the set expansion condition based on the target matching results of each frame within the current time period includes:
[0018] If the target matching result of each frame in the current time period is a target matching failure, and the time difference between the current time period and the first appearance of the target pet meets the preset time difference, then it is determined that the current time period meets the set expansion condition.
[0019] Otherwise, it is determined that the current time period does not meet the set expansion condition.
[0020] Optionally, determining the relationship between the target pet and surrounding pedestrians based on the target matching results of each frame within a set time period includes:
[0021] If the target matching result of each frame within the set time period is a target matching failure, then it is determined that the relationship between the target pet and the surrounding pedestrians is that there is no pet owner among the surrounding pedestrians; if the target matching result of at least one frame within the set time period is a target matching success, then it is determined that the relationship between the target pet and the surrounding pedestrians is that there is a pet owner among the surrounding pedestrians.
[0022] The step of determining whether the target pet is lost based on its relationship with surrounding pedestrians includes:
[0023] If the target pet is not associated with any of the pedestrians, then the target pet is determined to be lost; if the target pet is not associated with any of the pedestrians, then the target pet is determined to be not currently lost.
[0024] Optionally, when it is determined that the target pet is not currently lost, the method further includes:
[0025] The set of pet owners of the target pet is updated based on the surrounding pedestrian tracking results within the current time period, so as to remove pedestrian tracking results in the pet owner set that do not belong to the surrounding pedestrian tracking results.
[0026] Optionally, obtaining pedestrian tracking results in the area where the target pet first appeared includes:
[0027] Acquire the target detection frame, which is the detection frame that detects the target pet;
[0028] Based on the target detection frame, obtain all detection frames within a set time period before and after the target detection frame;
[0029] Based on the pedestrian tracking results of all detected frames within the specified time period, the pedestrian tracking results of the area where the target pet first appeared are obtained.
[0030] Optionally, the pedestrian tracking results for each frame can be obtained through the following steps:
[0031] Determine whether the target pet exists in the current detection frame based on the pet tracking results corresponding to the current detection frame;
[0032] When the target pet is present in the current detection frame, the pedestrian tracking results around the current frame are obtained based on the pedestrian tracking results of the current detection frame.
[0033] Secondly, embodiments of this application also provide a pet loss detection device, the device comprising:
[0034] The set acquisition unit is used to acquire pedestrian tracking results in the area where the target pet first appeared when the target pet is detected for the first time, and to obtain the set of pet owners of the target pet based on the pedestrian tracking results;
[0035] The relationship calculation unit is used to continuously acquire the surrounding pedestrian tracking results of the target pet, and determine the relationship between the target pet and the surrounding pedestrians within a preset time period based on the continuously acquired surrounding pedestrian tracking results of each frame and the pedestrian tracking results in the pet owner set. The relationship includes the absence of a pet owner among the surrounding pedestrians and the presence of a pet owner among the surrounding pedestrians.
[0036] The lost detection unit is used to determine whether the target pet is lost based on the relationship between the target pet and surrounding pedestrians within a preset time.
[0037] Thirdly, embodiments of this application also provide an electronic device, including:
[0038] Processor; and
[0039] A memory is configured to store computer-executable instructions, which, when executed, cause the processor to perform a pet-lost detection method.
[0040] Fourthly, embodiments of this application also provide a computer-readable storage medium storing one or more programs that, when executed by an electronic device including multiple applications, cause the electronic device to perform a pet loss detection method.
[0041] The above-mentioned at least one technical solution adopted in the embodiments of this application can achieve the following beneficial effects: When the target pet is detected for the first time, the embodiments of this application construct a set of pet owners of the target pet based on the pedestrian tracking results of the area where the target pet first appeared. It is not necessary to detect the specific owner of the target pet, thereby avoiding the dependence of the pet loss detection results on the accuracy of pet owner detection. After constructing the set of pet owners, the tracking results of the surrounding pedestrians of the target pet are continuously obtained, and the tracking results of the surrounding pedestrians and the tracking results of the pedestrians in the set of pet owners are used to determine whether there is a pet owner among the pedestrians around the target pet within a preset time. In this way, it is possible to determine whether the target pet is lost based on the relationship between the target pet and the surrounding pedestrians within a preset time.
[0042] The pet loss detection in this application uses pedestrian tracking results as basic data. Therefore, the main processing of the basic data can be completed by designing a relatively simple target matching algorithm, thereby enabling fast and accurate detection of whether the target pet is lost. Attached Figure Description
[0043] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0044] Figure 1 This is a flowchart illustrating a pet loss detection method according to an embodiment of this application;
[0045] Figure 2 This is a schematic diagram of the structure of a pet loss detection device according to an embodiment of this application;
[0046] Figure 3This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0048] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0049] The pet missing detection method provided in this application embodiment can be used in any monitoring scenario, such as closed or semi-closed scenarios like scenic spots, communities, and parks where monitoring cameras are deployed, or roadside scenarios where roadside cameras are deployed.
[0050] For ease of explanation, the following embodiments of this application use roadside equipment as an example. Figure 1 The illustrated pet-lost detection method uses an example of its execution entity. It is understood that the execution entity in this embodiment can also be other devices or systems, such as roadside cameras, roadside edge computing systems, or chip systems. A chip system includes at least one processor, and a communication interface or memory, wherein the memory stores programs or instructions, and the communication interface provides information or data input / output functions to the processor. Alternatively, the execution entity of the pet-lost detection method in this embodiment can be software or hardware, and different execution steps can be centralized or distributed.
[0051] like Figure 1 As shown in the embodiments of this application, a pet loss detection method includes at least the following steps S110 to S140:
[0052] Step S110: When the target pet is detected for the first time, obtain the pedestrian tracking results of the area where the target pet first appeared, and obtain the pet owner set of the target pet based on the pedestrian tracking results.
[0053] The pet loss detection method of this application embodiment can be executed by a roadside device. The roadside device can detect whether a target pet appears for the first time based on the current pet tracking results. For a target pet appearing for the first time, its owner is often nearby. Therefore, when a target pet is detected for the first time, all pedestrian tracking results in the current area of the target pet can be obtained, and all the currently obtained pedestrian tracking results can be considered as possible owners of the target pet, thereby constructing a set of pet owners.
[0054] As can be seen, this application does not require detecting the specific owner of the target pet, but rather considers pedestrians near the target pet as its possible owners. In this way, the basic data for detecting lost pets can be quickly obtained by using the target tracking results of roadside equipment.
[0055] Step S120: Continuously acquire the surrounding pedestrian tracking results of the target pet, and determine the relationship between the target pet and the surrounding pedestrians within a preset time period based on the continuously acquired surrounding pedestrian tracking results of each frame and the pedestrian tracking results in the pet owner set. The relationship includes the absence of a pet owner among the surrounding pedestrians and the presence of a pet owner among the surrounding pedestrians.
[0056] Current technologies for detecting lost pets often rely on the distance between the pet and its owner. For example, if the distance between the pet and its owner continuously increases until it exceeds the normal following distance, the pet is considered lost. This means that current technologies are heavily dependent on the accuracy of the pet owner's detection. When a stranger is mistakenly identified as the pet owner, the current technology will fail to provide reliable results.
[0057] Unlike existing technologies, this application first considers pedestrians around the target pet when it first appears as potential owners of the target pet. Then, within a preset time period, it continuously determines whether the pedestrians around the target pet include potential owners from the pet owner set. If no potential owners from the pet owner set appear among the pedestrians around the target pet, it can be determined that the target pet has gone missing. If, during the continuous detection process, a potential owner from the pet owner set appears among the pedestrians around the target pet, it can be determined that the target pet is in a following state and has not gone missing.
[0058] Here, the specific value of the preset time can be flexibly set according to the actual situation, such as 10 minutes, 30 minutes, etc., and this application embodiment does not make specific limitations here.
[0059] Step S130: Determine whether the target pet is lost based on the relationship between the target pet and the surrounding pedestrians.
[0060] like Figure 1As shown in the pet loss detection example, this embodiment of the application can construct a set of pet owners for the target pet based on the pedestrian tracking results in the area where the target pet is first located. It does not require detecting the specific owner of the target pet, thus avoiding the dependence of the pet loss detection results on the accuracy of pet owner detection. After constructing the set of pet owners, it continuously acquires the pedestrian tracking results around the target pet. Based on the pedestrian tracking results of the surrounding pedestrians and the pedestrian tracking results in the set of pet owners, it can determine whether there is a pet owner among the pedestrians around the target pet within a preset time period. Therefore, it can determine whether the target pet is lost based on the relationship between the target pet and the surrounding pedestrians within the preset time period. The pet loss detection algorithm of this embodiment of the application relies on the pet tracking results and pedestrian tracking results provided by roadside equipment. A relatively simple data processing algorithm can be designed to complete the processing of the basic data, thereby enabling fast and accurate detection of whether the target pet is lost.
[0061] In some embodiments of this application, in step S110 above, the determination of whether the target pet has been detected for the first time is made through the following steps:
[0062] Get the current pet tracking results;
[0063] The presence of the target pet, which is first observed, is determined based on the pet tracking results.
[0064] When the roadside equipment acquires a detection frame, it can perform target detection processing on the detection frame and track and match the detected target according to the target tracking and matching algorithm to obtain the target tracking result, which may include the target tracking status and the target's position in each frame. The object corresponding to the target can be set according to requirements. In this embodiment, the target includes at least pets and pedestrians. Here, pets include, for example, various common pets such as pet cats and pet dogs.
[0065] For the pet detected in the current frame, its tracking status can include "tracking in progress" and "newly appeared." If the pet's tracking status is "tracking in progress," it means the target can be continuously detected and has a pre-built set of pet owners. Therefore, the previously built set of pet owners can be reused for pet loss detection without needing to rebuild the set. However, if the pet's tracking status is "newly appeared," it means that the detection box of the pet in the current frame cannot match any detection boxes in the previous frame, indicating that it may be a newly appeared pet. In this case, it is necessary to build a set of pet owners for the pet.
[0066] It should be noted that a pet's tracking status being "newly appeared" does not necessarily mean that the pet is being detected for the first time. For example, the pet may have appeared before and been continuously detected, but due to reasons such as errors in the tracking matching algorithm, missed detections by the detection algorithm, or occlusion of the pet, the detection box of the pet in the current frame may not be able to match the detection box in the previous frame. In any case, it is not possible to obtain the pet owner set based on historical information. Therefore, it is necessary to construct a corresponding pet owner set for the first appearance of a pet.
[0067] In some embodiments of this application, step S110 above, obtaining pedestrian tracking results in the area where the target pet first appeared, includes:
[0068] Acquire the target detection frame, which is the detection frame that detects the target pet;
[0069] Based on the target detection frame, obtain all detection frames within a set time before and after the target detection frame (e.g., 1 second before and after, of course, the set time before and after can be adjusted as needed);
[0070] Based on the pedestrian tracking results of all detected frames within the specified time period, the pedestrian tracking results of the area where the target pet first appeared are obtained.
[0071] In this embodiment, image data or video frames from roadside cameras can be used as detection frames. The roadside device performs target detection on the detection frames provided by the roadside cameras and uses a target tracking and matching algorithm to track and match the detected targets. This tracking and matching process includes inter-frame matching within the same roadside camera and inter-frame matching between multiple roadside cameras. Therefore, in some optional solutions of this embodiment, when acquiring a target detection frame, the roadside camera corresponding to the target detection frame can be further determined. Thus, when acquiring all detection frames within a set time period before and after the target detection frame, specifically, all detection frames of the roadside camera within the set time period before and after the target detection frame are acquired, thereby obtaining all pedestrian tracking results corresponding to all detection frames.
[0072] When this application obtains pedestrian tracking results for the area where the target pet first appears, it can add each pedestrian tracking result to the pet owner set. Alternatively, the pedestrian IDs from the tracking results can be added to the pet owner set as set elements. This allows for ID matching between the target pet and surrounding pedestrians when determining the relationship between the target pet and the pedestrians in the pet owner set, further improving the target matching speed and quickly determining whether a pet owner exists among the pedestrians surrounding the target pet.
[0073] After obtaining the set of pet owners of the target pet, this application embodiment continuously acquires the tracking results of pedestrians around the target pet. In this application embodiment, "tracking results of pedestrians around the target pet" can be understood as pedestrians within the field of view of the same roadside camera as the target pet. For example, in one embodiment, the tracking results of pedestrians around the target pet in each frame can be acquired through the following steps:
[0074] Determine whether the target pet exists in the current detection frame based on the pet tracking results corresponding to the current detection frame;
[0075] When the target pet is present in the current detection frame, the pedestrian tracking results around the current frame are obtained based on the pedestrian tracking results of the current detection frame.
[0076] In this way, pedestrians around the target pet can be quickly identified. Of course, in other embodiments of this application, pedestrians around the target pet can also be calculated based on distance. Those skilled in the art can set corresponding distance calculation algorithms based on the range of "around".
[0077] In some embodiments of this application, the step S120 above, which determines the relationship between the target pet and surrounding pedestrians within a preset time period based on the continuously acquired pedestrian tracking results for each frame and the pedestrian tracking results in the pet owner set, specifically includes:
[0078] The continuously acquired pedestrian tracking results for each frame are matched with the pedestrian tracking results in the pet owner set to obtain the target matching results for each frame within a set time period.
[0079] The relationship between the target pet and the surrounding pedestrians is determined based on the target matching results of each frame within a set time period.
[0080] As mentioned earlier, this embodiment can perform target ID matching on the pedestrian tracking results in each frame with the pedestrian tracking results in the pet owner set to quickly obtain the target matching result for each frame. If the target matching result for each frame fails within a set time, it means that the pedestrians around the target pet within that set time do not include the possible owners in the pet owner set, and the target pet is likely to be lost. If the target matching result for one or more frames is successful within the set time, it means that the pedestrians around the target pet within that set time include the possible owners in the pet owner set, and the target pet is unlikely to be lost.
[0081] Of course, in other embodiments, target matching can also be performed based on a preset target similarity measurement method, which includes: Euclidean distance, cosine similarity, Pearson correlation coefficient, modified cosine similarity, Hamming distance, Manhattan distance, etc.
[0082] Research has found that in some special scenarios, when the target pet first appears, the owner of the target pet may not be around the target pet; or, due to reasons such as errors in the tracking and matching algorithm, missed detection by the detection algorithm, or pedestrians being obscured, the pedestrian tracking results in the area where the target pet first appears may not include the owner of the target pet.
[0083] To address the aforementioned issues, this application can expand the pet owner set by adding pet owners to the set through one or more expansions, thereby improving the accuracy of target pet missing detection. Specifically:
[0084] Based on the target matching results of each frame within the current time period, determine whether the current time period meets the set expansion condition. The set expansion condition is used to determine whether there is a time period within the preset time that needs to be expanded for the pet owner set.
[0085] When the set expansion condition is met in the current time period, the pet owner set is expanded according to the pedestrian tracking target in the area where the target pet is located in the current time period. The surrounding pedestrian tracking results of each subsequent frame are matched with the pedestrian tracking target in the expanded pet owner set. The target matching result of each frame in the current time period and the target matching result of each subsequent frame are obtained.
[0086] If the set expansion condition is not met in the current time period, the target matching result of each frame in the set time period is obtained based on the target matching result between the surrounding pedestrian tracking result of each frame in the set time period and the pedestrian tracking target in the pet owner set.
[0087] In some possible implementations of this embodiment, determining whether the current time period meets the set expansion condition based on the target matching results of each frame within the current time period includes:
[0088] If the target matching result of each frame in the current time period is a target matching failure, and the time difference between the current time period and the first appearance of the target pet meets the preset time difference, then it is determined that the current time period meets the set expansion condition.
[0089] Otherwise, it is determined that the current time period does not meet the set expansion condition.
[0090] The set expansion conditions of this implementation scheme limit the current time period from two dimensions: one dimension is the target matching result of each frame in the current time period, and the other dimension is the time difference between the current time period and the first appearance of the target pet.
[0091] As mentioned earlier, when the target pet first appears, the pet owner is often nearby. Therefore, a reference time point for expanding the set can be set based on the time when the target pet first appears. For example, the first minute and the second minute after the target pet first appears can be used as reference time points. The time difference between the reference time point and the time when the target pet first appears should not be too large. If the time difference is too large, a large number of non-pet owners will be added to the pet owner set, increasing the computational overhead.
[0092] Furthermore, the fact that the target matching result fails in every frame of the current time period can also indicate to some extent that the current pet owner set may not include the owner information of the target pet. Therefore, this implementation scheme judges the current time period through the above two dimensions.
[0093] Understandably, in other alternative solutions, the current time can also be judged by combining other dimensions of the current time period. For example, the frequency of each surrounding pedestrian in the current time period can be combined. If the frequency of each surrounding pedestrian in the current time period is less than the set frequency, such as each surrounding pedestrian only appearing in a few detection frames, it means that the surrounding pedestrians of the target pet change frequently in the current time period. It is highly likely that there is no pet owner among the surrounding pedestrians in the current time period. At this time, it can be determined that the current time period does not meet the set expansion condition.
[0094] It should be noted that the duration of the current time period can be preset, and those skilled in the art can flexibly set the duration of the current time period as needed. This embodiment does not specifically limit the duration of the current time period.
[0095] In some scenarios, the first and second minutes after the target pet's first appearance are used as reference time points. If, within the first minute after the target pet's first appearance, every frame's target matching result fails, then all pedestrian tracking results of the current detection frame corresponding to the first minute can be added to the pet owner set. Alternatively, all pedestrian tracking results of all detection frames within that first minute can be added to the pet owner set. Then, in the following second minute, the surrounding pedestrian tracking results of each frame are matched against the pedestrian tracking results in the first expanded pet owner set using target ID matching. If, at this point, every frame's target matching result in the second minute fails, then all pedestrian tracking results of the current detection frame corresponding to the second minute are added to the pet owner set for a second set expansion. Then, in the following (t-2, where t is a preset time) minute, the surrounding pedestrian tracking results of each frame are matched against the pedestrian tracking results in the second expanded pet owner set using target ID matching. This yields the target matching results for each frame within the preset time t.
[0096] In some embodiments of this application, determining the relationship between the target pet and surrounding pedestrians based on the target matching results of each frame within a set time period includes:
[0097] If the target matching result of each frame within the set time t is a target matching failure, then it is determined that the relationship between the target pet and the surrounding pedestrians is that there is no pet owner among the surrounding pedestrians;
[0098] If at least one frame within the set time t results in a successful target match, then the relationship between the target pet and the surrounding pedestrians is determined to be that the pet owner exists among the surrounding pedestrians.
[0099] In some alternative embodiments, when the target matching result for each frame within the set time t is a target matching failure, the method may further include:
[0100] The frequency of occurrence of each surrounding pedestrian is obtained based on the surrounding pedestrian tracking results of each frame within the set time period;
[0101] If the frequency of each surrounding pedestrian is less than the set frequency, then the relationship between the target pet and the surrounding pedestrians is determined to be that there is no pet owner among the surrounding pedestrians;
[0102] Otherwise, the relationship between the target pet and surrounding pedestrians is determined to be that a pet owner exists among the surrounding pedestrians. Optionally, the tracking results of surrounding pedestrians corresponding to the maximum frame rate can also be added to the target pet's pet owner set.
[0103] In practical applications, it is possible that neither the initially constructed set of pet owners nor the expanded set of pet owners contains a pet owner. In such cases, this implementation further determines the frequency of each surrounding pedestrian within a set time period, and combines the frequency of each surrounding pedestrian to further determine whether there is a pet owner among the pedestrians surrounding the target pet.
[0104] Assuming a set time period includes 300 detection frames, if all 300 frames result in a failed target match, but a particular pedestrian appears in more than 200 detection frames within those 300 frames, it indicates that this pedestrian is likely the owner of the target pet, and the presence of a pet owner among the surrounding pedestrians is determined. If the number of detection frames for each surrounding pedestrian is less than 50, it indicates that none of the surrounding pedestrians within the set time period are the owner of the target pet.
[0105] In some embodiments of this application, step S130 above, determining whether the target pet is lost based on the relationship between the target pet and surrounding pedestrians, includes:
[0106] If the target pet is not associated with any of the surrounding pedestrians, then the target pet is determined to be lost. In this case, the roadside equipment can generate a lost pet alert and broadcast the alert, or send the alert to the management platform so that the management personnel can handle the lost pet in a timely manner.
[0107] If the target pet is related to the surrounding pedestrians by having a pet owner among them, then it is determined that the target pet is not currently lost. At this time, the pet owner set of the target pet can be updated based on the surrounding pedestrian tracking results within the current time period to remove pedestrian tracking results that do not belong to the surrounding pedestrian tracking results from the pet owner set, thereby reducing the computational load of the target pet in the subsequent loss detection process.
[0108] This application also provides a pet lost detection device 200, such as... Figure 2 As shown, a schematic diagram of a pet loss detection device according to an embodiment of this application is provided. The device 200 includes:
[0109] The set acquisition unit 210 is used to acquire pedestrian tracking results in the area where the target pet first appeared when the target pet is detected for the first time, and to obtain the set of pet owners of the target pet based on the pedestrian tracking results;
[0110] The relationship calculation unit 220 is used to continuously acquire the surrounding pedestrian tracking results of the target pet, and determine the relationship between the target pet and the surrounding pedestrians within a preset time period based on the continuously acquired surrounding pedestrian tracking results of each frame and the pedestrian tracking results in the pet owner set. The relationship includes the absence of a pet owner among the surrounding pedestrians and the presence of a pet owner among the surrounding pedestrians.
[0111] The lost detection unit 230 is used to determine whether the target pet is lost based on the relationship between the target pet and surrounding pedestrians within a preset time.
[0112] In some embodiments of this application, the relationship calculation unit 220 is specifically used to perform target matching between the continuously acquired surrounding pedestrian tracking results of each frame and the pedestrian tracking results in the pet owner set, to obtain the target matching results of each frame within a set time period; and to determine the relationship between the target pet and the surrounding pedestrians based on the target matching results of each frame within the set time period.
[0113] In some embodiments of this application, the relationship calculation unit 220 is further specifically used to determine whether the current time period meets the set expansion condition based on the target matching results of each frame within the current time period; when the current time period meets the set expansion condition, the pet owner set is expanded based on the pedestrian tracking targets in the area where the target pet is located during the current time period, and the subsequent surrounding pedestrian tracking results are matched with the pedestrian tracking targets in the expanded pet owner set, respectively, and the target matching results of each frame within the set time period are obtained based on the target matching results of each frame within the current time period and the target matching results of each subsequent frame; when the current time period does not meet the set expansion condition, the target matching results of each frame within the set time period are obtained based on the target matching results between the surrounding pedestrian tracking results of each frame within the set time period and the pedestrian tracking targets in the pet owner set.
[0114] In some embodiments of this application, the relationship calculation unit 220 is further specifically used to determine that the current time period meets the set expansion condition if the target matching result of each frame in the current time period is a target matching failure, and the time difference between the current time period and the first appearance of the target pet meets the preset time difference; otherwise, it is determined that the current time period does not meet the set expansion condition.
[0115] In some embodiments of this application, the relationship calculation unit 220 is further specifically used to determine that if the target matching result of each frame within the set time period is a target matching failure, the relationship between the target pet and the surrounding pedestrians is that there is no pet owner among the surrounding pedestrians; if the target matching result of at least one frame within the set time period is a target matching success, the relationship between the target pet and the surrounding pedestrians is that there is a pet owner among the surrounding pedestrians.
[0116] In some embodiments of this application, the lost detection unit 230 is specifically used to determine that the target pet has gone missing if the relationship between the target pet and the surrounding pedestrians is that there is no pet owner among the surrounding pedestrians; and to determine that the target pet is not currently lost if the relationship between the target pet and the surrounding pedestrians is that there is a pet owner among the surrounding pedestrians.
[0117] In some embodiments of this application, the lost detection unit 230 is further specifically used to update the pet owner set of the target pet based on the surrounding pedestrian tracking results within the current time period when it is determined that the target pet is not currently lost, so as to remove pedestrian tracking results in the pet owner set that do not belong to the surrounding pedestrian tracking results.
[0118] In some embodiments of this application, the collection acquisition unit 210 is specifically used to acquire a target detection frame, which refers to a detection frame that detects the target pet; acquire all detection frames within a set time period before and after the target detection frame; and obtain the pedestrian tracking results of the area where the target pet first appeared based on the pedestrian tracking results of all detection frames within the set time period before and after the target detection frame.
[0119] In some embodiments of this application, the relationship calculation unit 220 is further specifically used to determine whether the target pet exists in the current detection frame based on the pet tracking result corresponding to the current detection frame; when the target pet exists in the current detection frame, the pedestrian tracking result around the current frame is obtained based on the pedestrian tracking result of the current detection frame.
[0120] It is understood that the above-mentioned pet lost detection device can realize all the steps of the pet lost detection method provided in the foregoing embodiments. The relevant explanations of the pet lost detection method are applicable to the pet lost detection device, and will not be repeated here.
[0121] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Please refer to it. Figure 3 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0122] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0123] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0124] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming a pet-lost detection device at the logical level. The processor executes the program stored in memory and specifically performs the following operations:
[0125] When a target pet is detected for the first time, the pedestrian tracking results of the area where the target pet first appeared are obtained, and the set of pet owners of the target pet is obtained based on the pedestrian tracking results;
[0126] The system continuously acquires the tracking results of pedestrians around the target pet, and determines the relationship between the target pet and the surrounding pedestrians within a preset time period based on the continuously acquired tracking results of pedestrians around each frame and the tracking results of pedestrians in the pet owner set. The relationship includes the absence of a pet owner among the surrounding pedestrians and the presence of a pet owner among the surrounding pedestrians.
[0127] Whether the target pet is lost is determined based on the relationship between the target pet and surrounding pedestrians within a preset time period.
[0128] The above is as stated in this application. Figure 1The method executed by the pet-lost detection device disclosed in the illustrated embodiment can be applied to a processor, or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0129] The electronic device can also perform Figure 1 The method for implementing a pet lost detection device, and how to enable the pet lost detection device to function in... Figure 1 The functions of the embodiments shown are not described in detail here.
[0130] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform... Figure 1 The method executed by the pet loss detection device in the illustrated embodiment is specifically used to perform the following:
[0131] When a target pet is detected for the first time, the pedestrian tracking results of the area where the target pet first appeared are obtained, and the set of pet owners of the target pet is obtained based on the pedestrian tracking results;
[0132] The system continuously acquires the tracking results of pedestrians around the target pet, and determines the relationship between the target pet and the surrounding pedestrians within a preset time period based on the continuously acquired tracking results of pedestrians around each frame and the tracking results of pedestrians in the pet owner set. The relationship includes the absence of a pet owner among the surrounding pedestrians and the presence of a pet owner among the surrounding pedestrians.
[0133] Whether the target pet is lost is determined based on the relationship between the target pet and surrounding pedestrians within a preset time period.
[0134] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0135] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0136] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0137] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0138] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0139] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0140] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0141] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0142] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0143] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for detecting lost pets, characterized in that, The method includes: When a target pet is detected for the first time, the pedestrian tracking results of the area where the target pet first appeared are obtained, and the set of pet owners of the target pet is obtained based on the pedestrian tracking results; The system continuously acquires the tracking results of pedestrians around the target pet, and determines the relationship between the target pet and the surrounding pedestrians within a preset time period based on the continuously acquired tracking results of pedestrians around each frame and the tracking results of pedestrians in the pet owner set. The relationship includes the absence of a pet owner among the surrounding pedestrians and the presence of a pet owner among the surrounding pedestrians. Determine whether the target pet is lost based on its relationship with surrounding pedestrians within a preset time period; The step of determining the relationship between the target pet and surrounding pedestrians within a preset time period based on the continuously acquired pedestrian tracking results for each frame and the pedestrian tracking results in the pet owner set includes: The continuously acquired pedestrian tracking results for each frame are matched with the pedestrian tracking results in the pet owner set to obtain the target matching results for each frame within a set time period. The relationship between the target pet and surrounding pedestrians is determined based on the target matching results of each frame within a set time period. The step of continuously acquiring the surrounding pedestrian tracking results for each frame and performing target matching with the pedestrian tracking results in the pet owner set to obtain the target matching results for each frame within a set time period includes: Determine whether the current time period meets the set expansion condition based on the target matching results of each frame within the current time period; When the set expansion condition is met in the current time period, the pet owner set is expanded according to the pedestrian tracking target in the area where the target pet is located in the current time period. The surrounding pedestrian tracking results of each subsequent frame are matched with the pedestrian tracking target in the expanded pet owner set. The target matching result of each frame in the current time period and the target matching result of each subsequent frame are obtained. When the set expansion condition is not met in the current time period, the target matching result of each frame within the set time period is obtained based on the target matching result between the surrounding pedestrian tracking result of each frame within the set time period and the pedestrian tracking target in the pet owner set. The step of determining whether the current time period meets the set expansion condition based on the target matching results of each frame within the current time period includes: If the target matching result of each frame in the current time period is a target matching failure, and the time difference between the current time period and the first appearance of the target pet meets the preset time difference, then it is determined that the current time period meets the set expansion condition. Otherwise, it is determined that the current time period does not meet the set expansion condition.
2. The pet lost detection method as described in claim 1, characterized in that, The step of determining the relationship between the target pet and surrounding pedestrians based on the target matching results of each frame within a set time period includes: If the target matching result of each frame within the set time period is a target matching failure, then it is determined that the relationship between the target pet and the surrounding pedestrians is that there is no pet owner among the surrounding pedestrians; if the target matching result of at least one frame within the set time period is a target matching success, then it is determined that the relationship between the target pet and the surrounding pedestrians is that there is a pet owner among the surrounding pedestrians. The step of determining whether the target pet is lost based on its relationship with surrounding pedestrians includes: If the target pet is not associated with any of the pedestrians, then the target pet is determined to be lost; if the target pet is not associated with any of the pedestrians, then the target pet is determined to be not currently lost.
3. The pet lost detection method as described in claim 2, characterized in that, When it is determined that the target pet is not currently lost, the method further includes: The set of pet owners for the target pet is updated based on the surrounding pedestrian tracking results within the current time period, in order to remove pedestrian tracking results from the set of pet owners that do not belong to the surrounding pedestrian tracking results.
4. The pet lost detection method as described in claim 2, characterized in that, When the target matching result for each frame within the set time period is a target matching failure, the method further includes: The frequency of occurrence of each surrounding pedestrian is obtained based on the surrounding pedestrian tracking results of each frame within the set time period; If the frequency of each surrounding pedestrian is less than the set frequency, then the relationship between the target pet and the surrounding pedestrians is determined to be that there is no pet owner among the surrounding pedestrians; Otherwise, the relationship between the target pet and the surrounding pedestrians is determined to be that there is a pet owner among the surrounding pedestrians.
5. The pet loss detection method as described in claim 1, characterized in that, The step of obtaining pedestrian tracking results in the area where the target pet first appeared includes: Acquire the target detection frame, which is the detection frame that detects the target pet; Based on the target detection frame, obtain all detection frames within a set time period before and after the target detection frame; Based on the pedestrian tracking results of all detected frames within the specified time period, the pedestrian tracking results of the area where the target pet first appeared are obtained.
6. The pet loss detection method as described in claim 1, characterized in that, The following steps are used to obtain the surrounding pedestrian tracking results for each frame: Determine whether the target pet exists in the current detection frame based on the pet tracking results corresponding to the current detection frame; When the target pet is present in the current detection frame, the pedestrian tracking results around the current frame are obtained based on the pedestrian tracking results of the current detection frame.
7. A pet loss detection device, characterized in that, The device includes: The set acquisition unit is used to acquire pedestrian tracking results in the area where the target pet first appeared when the target pet is detected for the first time, and to obtain the set of pet owners of the target pet based on the pedestrian tracking results; The relationship calculation unit is used to continuously acquire the surrounding pedestrian tracking results of the target pet, and determine the relationship between the target pet and the surrounding pedestrians within a preset time period based on the continuously acquired surrounding pedestrian tracking results of each frame and the pedestrian tracking results in the pet owner set. The relationship includes the absence of a pet owner among the surrounding pedestrians and the presence of a pet owner among the surrounding pedestrians. The lost detection unit is used to determine whether the target pet is lost based on the relationship between the target pet and surrounding pedestrians within a preset time. The relation calculation unit is specifically used for: The continuously acquired pedestrian tracking results for each frame are matched with the pedestrian tracking results in the pet owner set to obtain the target matching results for each frame within a set time period. The relationship between the target pet and surrounding pedestrians is determined based on the target matching results of each frame within a set time period. The relation calculation unit is specifically used for: Determine whether the current time period meets the set expansion condition based on the target matching results of each frame within the current time period; When the set expansion condition is met in the current time period, the pet owner set is expanded according to the pedestrian tracking target in the area where the target pet is located in the current time period. The surrounding pedestrian tracking results of each subsequent frame are matched with the pedestrian tracking target in the expanded pet owner set. The target matching result of each frame in the current time period and the target matching result of each subsequent frame are obtained. When the set expansion condition is not met in the current time period, the target matching result of each frame within the set time period is obtained based on the target matching result between the surrounding pedestrian tracking result of each frame within the set time period and the pedestrian tracking target in the pet owner set. The relation calculation unit is specifically used for: If the target matching result of each frame in the current time period is a target matching failure, and the time difference between the current time period and the first appearance of the target pet meets the preset time difference, then it is determined that the current time period meets the set expansion condition. Otherwise, it is determined that the current time period does not meet the set expansion condition.
8. An electronic device, characterized in that, include: processor; as well as A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the pet loss detection method as described in any one of claims 1 to 6.