A method, device and computer-readable storage medium for detecting pet leashes

By automatically detecting pets and human figures in surveillance videos and using convolutional neural networks to determine whether they are on leashes, and marking leashed pets and human figures, the problem of untimely supervision and repeated detection in existing technologies is solved, achieving efficient pet supervision and information reminders.

CN114463253BActive Publication Date: 2025-10-31ZHEJIANG DAHUA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111572079.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-21
Publication Date
2025-10-31
Estimated Expiration
2041-12-21

AI Technical Summary

Technical Problem

In the current technology, the supervision of pet walking behavior in urban residential areas mainly relies on manual monitoring, which leads to untimely monitoring, missed monitoring and difficulty in obtaining evidence, and cannot effectively avoid repeated testing.

Method used

By automatically detecting pets and human figures in surveillance videos to determine whether they are on leashes, a convolutional neural network is used to identify whether human figures and pets in combined images are on leashes, and pets and human figures that are on leashes are marked to avoid repeated detection in the future.

Benefits of technology

It improved the accuracy and breadth of supervision, reduced the waste of computing resources, lowered the computational load, and enabled 24/7 automatic monitoring and information alerts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114463253B_ABST
    Figure CN114463253B_ABST
Patent Text Reader

Abstract

This invention discloses a method, device, and computer-readable storage medium for detecting pet leashes. The method includes: acquiring an image to be detected; performing pet and human figure detection on the image; and, in response to detecting a pet and a human figure, acquiring the position coordinates of the pet and the human figure; acquiring combined images, each combined image including a combination of any pet and any human figure; and performing leash recognition on all combined images; and, in response to the recognition result of a combined image indicating that the pet is leashed, marking and associating the pet and human figure in the combined image, and stopping leash detection for the pet with the associated mark. Through this method, the present invention avoids redundant detection, saves resources, and reduces computational load.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method, device, and computer-readable storage medium for detecting pet leashes. Background Technology

[0002] With the diversification of people's leisure activities and emotional needs, pet ownership has become a popular pastime for many families. As the number of pet owners rapidly expands, the number of pets in urban residential areas is also gradually increasing, and dog walking in these areas is becoming more frequent. Consequently, responsible pet ownership has become a demand for many people, but uncivilized pet ownership behaviors still occur from time to time in urban residential areas.

[0003] Currently, the judgment and supervision of illegal pet walking in public places are mainly accomplished through manual monitoring, which is untimely, prone to omissions, and difficult to obtain evidence. Summary of the Invention

[0004] The main technical problem solved by this invention is to provide a method, device and computer-readable storage medium for detecting pet leashes, which can avoid repeated detection, save resources and reduce computational load.

[0005] To solve the above-mentioned technical problems, one technical solution adopted by the present invention is: to provide a pet leash detection method, which includes: acquiring an image to be detected; performing pet and human figure detection on the image to be detected, and in response to detecting a pet and a human figure, acquiring the pet's position coordinates and the human figure's position coordinates; acquiring combined images, each combined image including a combination of any pet and any human figure, and performing leash recognition on all combined images; in response to the recognition result of the combined image being leashed, marking and associating the pet and human figure in the combined image, and stopping the leash detection of the pet with the associated marking.

[0006] The suspension of detection of pets with associated tags includes: tracking pets and humanoids with associated tags separately; in response to a humanoid with an associated tag leaving the monitoring area, ceasing to combine images of pets with associated tags with other humanoids; and / or in response to a pet with an associated tag leaving the monitoring area, ceasing to combine images of humanoids with associated tags with other pets.

[0007] The tracking of pets and humanoids with associated tags includes: tracking pets and humanoids with associated tags based on feature extraction and search algorithms.

[0008] Specifically, a coordinate system is established with the coordinates of the top-left corner vertex of the image to be detected as the origin. Pet and human figures are detected in the image. In response to the detection of pet and human figures, the position coordinates of the pet and human figures are obtained by: obtaining a pet region image, which is a rectangular region image containing the pet, and using the combination of the coordinates of the top-left corner vertex and the bottom-right corner vertex of the pet region image as the position coordinates of the pet; obtaining a human figure region image, which is a rectangular region image containing the human figure, and using the combination of the coordinates of the top-left corner vertex and the bottom-right corner vertex of the human figure region image as the position coordinates of the human figure.

[0009] The process of obtaining the combined image includes: comparing the x-coordinate of the top left corner of the pet region image with the x-coordinate of the top left corner of the human region image, and using the smaller one as the x-coordinate of the top left corner of the combined image; comparing the y-coordinate of the top left corner of the pet region image with the y-coordinate of the top left corner of the human region image, and using the smaller one as the y-coordinate of the top left corner of the combined image; comparing the x-coordinate of the bottom right corner of the pet region image with the x-coordinate of the bottom right corner of the human region image, and using the larger one as the x-coordinate of the bottom right corner of the combined image; and comparing the y-coordinate of the bottom right corner of the pet region image with the y-coordinate of the bottom right corner of the human region image, and using the larger one as the y-coordinate of the bottom right corner of the combined image.

[0010] The method utilizes convolutional neural networks to identify whether human figures and pets in composite images are on leashes; the convolutional neural networks include any one or more combinations of AlexNet, ResNet, Inception, and VGG.

[0011] Specifically, if a pet is detected but no human figure is detected, the pet region image is acquired and the corresponding pet region image is output as "the pet is not on a leash"; or if the same pet is detected as not on a leash in multiple combined images, the pet is output as "the pet is not on a leash".

[0012] In response to detecting that a pet is not on a leash, the system outputs an image of the area where the pet is not on a leash and an image of the area to be detected, and provides an information reminder.

[0013] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is to provide a pet leash detection device, which includes a processor for executing the above-mentioned pet leash detection method.

[0014] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is to provide a computer-readable storage medium for storing instruction / program data, which can be executed to implement the above-mentioned pet leash detection method.

[0015] The beneficial effects of this invention are as follows: Unlike existing technologies, this invention automatically detects pets and human figures in surveillance videos, and combines them in pairs to determine whether they are on leashes. It not only determines whether the pet is on a leash, but also considers the case where the leash is on but detached from the person's hand. This combined judgment makes the application scenarios more extensive and the accuracy higher. At the same time, pets and human figures that are determined to be on leashes are marked so that they are not detected on leashes in subsequent tests, avoiding repeated detection, saving resources and reducing the amount of computation. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating a pet leash detection method according to an embodiment of this application;

[0017] Figure 2 This is a flowchart illustrating another pet leash detection method in the embodiments of this application;

[0018] Figure 3 This is a flowchart illustrating the specific method for detecting pet leashes in the embodiments of this application;

[0019] Figure 4 This is a schematic diagram of a dog detection frame and a human detection frame in an embodiment of this application;

[0020] Figure 5 yes Figure 4 A schematic diagram of a combined image of a dog detection box and a human detection box;

[0021] Figure 6 This is a schematic diagram of the pet leash detection device in the embodiments of this application;

[0022] Figure 7 This is a schematic diagram of the structure of the pet leash detection device in the embodiments of this application;

[0023] Figure 8 This is a schematic diagram of the structure of a computer-readable storage medium in an embodiment of this application. Detailed Implementation

[0024] To make the objectives, technical solutions, and effects of the present invention clearer and more explicit, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0025] This application provides a method for detecting pet leashes. By automatically detecting pets and human figures in surveillance videos and combining the detection of whether the pets and human figures are on leashes, and considering the case where the pet is on a leash but the leash is detached from the person's hand, the pets and human figures that are judged to be on leashes are marked and will not be detected again, thus avoiding repeated detection, saving resources and reducing the amount of computation.

[0026] Please see Figure 1 , Figure 1This is a flowchart illustrating a pet leash detection method according to an embodiment of this application. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily reflect that result. Figure 1 The illustrated process sequence is limited. For example... Figure 1 As shown, this embodiment includes:

[0027] S110: Acquire the image to be detected.

[0028] Surveillance cameras are installed in places where pet supervision is required. The surveillance video captured by the surveillance cameras can be used to obtain images, and the video can be processed by extracting frames to obtain each frame of the surveillance video image as the image to be detected.

[0029] S130: Perform pet and human detection on the image to be detected. In response to the detection of pet and human, obtain the location coordinates of the pet and the location coordinates of the human.

[0030] The image to be detected is processed by using different detection algorithms to detect pets and human figures in the image, and the position coordinates of each pet and each human figure are obtained, that is, the position coordinates of the detection boxes of each pet and each human figure are obtained.

[0031] S150: Acquire combined images and perform leash recognition on all combined images.

[0032] Each pet is combined with all the human figures individually, and one pet and one human figure are combined into one group. Based on the position coordinates of the detection boxes of each pet and each human figure, a combined image containing the pets and human figures in a group is obtained.

[0033] Perform leash recognition on all combined images to identify whether there is a leash between the pet and the human figure.

[0034] S170: In response to the recognition result of the combined image being that the pet is on a leash, the pet and human figure in the combined image are marked and associated, and the detection of the leash for the pet with the associated mark is stopped.

[0035] If the result of leash recognition in the combined image is "leashed," it means that the human figure and pet in the combined image correspond to the person and pet being leashed. The human figure and pet are then associated with each other to ensure a match, and are excluded from subsequent detection. Leash detection for pets with associated tags is terminated. Terminating leash detection for a pet means that subsequent detection processes can still identify and detect the pet, but since it has been confirmed that the pet is leashed, there is no need to perform leash detection for matching the pet with other human figures.

[0036] In this implementation, pets and human figures in the surveillance video are automatically detected and paired to determine whether they are on a leash. This not only determines whether the pet is on a leash but also considers the case where the leash is loose from the person's hand. This combined judgment makes the application scenarios more extensive and the accuracy higher. At the same time, pets and human figures that are determined to be on a leash are marked so that they are not detected on a leash in the future, avoiding repeated detection, saving resources and reducing the amount of computation.

[0037] Please see Figure 2 , Figure 2 This is a flowchart illustrating another pet leash detection method implemented in this application. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily reflect that method. Figure 2 The illustrated process sequence is limited. For example... Figure 2 As shown, this embodiment includes:

[0038] S210: Acquire the image to be detected.

[0039] Surveillance cameras are installed in places where pet supervision is required. The surveillance video captured by the surveillance cameras can be used to obtain images, and the video can be processed by extracting frames to obtain each frame of the surveillance video image as the image to be detected.

[0040] S220: Perform pet detection on the image to be detected and obtain the pet region image; perform human detection on the image to be detected and obtain the human region image.

[0041] The images to be detected are processed using different detection algorithms to detect pets and human figures. The image is input into a pet detection model to detect pets. In one embodiment, the YOLO deep learning algorithm is used to detect pets, acquire a pet region image, and output the coordinates of the pet's position. The image is also input into a human detection model to detect human figures. In one embodiment, the YOLO deep learning algorithm is used to detect human figures, acquire a human region image, and output the coordinates of the human figure's position. The YOLO deep learning algorithm includes, but is not limited to, YOLOv1, YOLOv2, YOLOv3, YOLOv4, YOLOv5, and other YOLO-related algorithms.

[0042] Specifically, in this embodiment, the actual acquired coordinates are the rectangular bounding box coordinates containing the pet region image and the human region image. However, in the actual processing, the pet region image and the human region image are acquired first. The coordinates of the pet position and the human position can be rectangular bounding box coordinates, using the coordinates of the upper left and lower right corners of the rectangular bounding box as the rectangular bounding box coordinates. For example, if the coordinates of the upper left corner of the rectangular bounding box are (a1, b1) and the coordinates of the lower right corner of the rectangular bounding box are (a2, b2), then the coordinates of the rectangular bounding box are [(a1, b1), (a2, a2)]. First, a coordinate system is established, with the coordinates of the upper left vertex of the image to be detected as the origin (0, 0) to establish the XY coordinate system.

[0043] A pet detection model is used to detect pets, obtaining a rectangular image containing each pet. The combination of the coordinates of the top-left and bottom-right corners of the pet's region image is used as the pet's position coordinates. Similarly, a human detection model is used to detect humans, obtaining a rectangular image containing each human. The combination of the coordinates of the top-left and bottom-right corners of the human's region image is used as the human's position coordinates. Through intelligent detection, a total of n pets and m human figures were detected.

[0044] S230: Acquire combined images and perform rope recognition on all combined images.

[0045] Each pet is combined with all the human figures individually, with one pet and one human figure forming a group. This means combining each pet region image with all the human figure region images to obtain a combined image containing the corresponding pet and human figure region images. The coordinates of the combined image are obtained using the same coordinate acquisition method. In one embodiment, the smallest rectangular frame image containing the corresponding pet and human figure region images is used as the combined image. The x-coordinate of the top left corner of the pet region image is compared with the x-coordinate of the top left corner of the human figure region image, and the smaller one is used as the x-coordinate of the top left corner of the combined image. The y-coordinate of the top left corner of the pet region image is compared with the y-coordinate of the top left corner of the human figure region image, and the smaller one is used as the y-coordinate of the top left corner of the combined image. The x-coordinate of the bottom right corner of the pet region image is compared with the bottom right corner of the human figure region image, and the larger one is used as the bottom right corner of the combined image. The coordinates of the combined image are then obtained.

[0046] Using the above method, n pets and m human figures are combined to obtain n×m combined images, with each pet corresponding to m combined images. Leash detection is then performed on each of the n×m combined images to identify whether there is a leash connecting the pets and human figures. In this embodiment, the combined images are input into a convolutional neural network (CNN), which identifies whether the human figures and pets in the combined images are leashed. The CNN includes, but is not limited to, any one or more combinations of AlexNet, ResNet, Inception, and VGG, as well as networks improved upon based on these networks.

[0047] S240: In response to the detection of a pet and the absence of a human figure or multiple combined images of the same pet all indicating that the pet is not on a leash, output "Pet is not on a leash".

[0048] In one embodiment, if only a pet is detected and no human is detected during the pet detection and human detection process, it is assumed that the pet is not on a leash.

[0049] In another embodiment, if the recognition results of m combined images corresponding to the same pet are all "not on a leash", then the pet is also considered to be not on a leash.

[0050] When the output result is that the pet is not on a leash, the image of the pet area where the pet is not on a leash and the image to be detected are output simultaneously. The image of the pet area is superimposed on the image to be detected as evidence. The evidence image is saved and a reminder is sent to the venue supervisor.

[0051] S250: In response to the recognition result of the combined image being that the pet is on a leash, associate tags are set for the pet and human figure in the combined image, and the pet and human figure with the associate tags are tracked respectively.

[0052] In one embodiment, if the recognition result of the combined image is "on a leash," then it is considered that the pet is on a leash, and it is stated that the human figure and pet in the combined image are the corresponding person on a leash and the corresponding pet. The human figure and pet are then associated with each other to match them, and the human figure and pet are excluded from subsequent detection, thus stopping the detection of pets with associated tags.

[0053] In another implementation, if the recognition results of m combined images corresponding to the same pet are all "not on a leash," then the system checks again whether the pet has an association marker with a human figure. If it has an association marker, the pet is considered to be on a leash. If it does not have an association marker, the pet is considered to be not on a leash.

[0054] Based on feature extraction and search algorithms, the system tracks pets and humanoids with associated tags and continuously outputs information about pets and humanoids with associated tags.

[0055] S260: In response to a humanoid with an associated tag leaving the monitoring area, the image of a pet with an associated tag is no longer combined with that of other humanoids; or in response to a pet with an associated tag leaving the monitoring area, the image of a humanoid with an associated tag is no longer combined with that of other pets.

[0056] In one implementation, if a humanoid figure with an associated tag leaves the monitoring area during tracking and detection, the pet will not be combined with other humanoid figures in the subsequent pet-humanoid combination process; instead, the system will directly output that the pet is on a leash. In another implementation, if a pet with an associated tag leaves the monitoring area during tracking and detection, the corresponding humanoid figure will not be combined with other pets in the image.

[0057] In this implementation, deep learning algorithms are used to automatically detect pets and human figures in surveillance videos, pairing them to determine whether they are on leashes. This approach considers situations where the pet is on a leash but the leash is detached from the person's hand, broadening the application scenarios and increasing accuracy. Simultaneously, pets and human figures identified as being on leashes are marked and not further detected, avoiding duplicate detection, saving resources, and reducing computational load. During subsequent tracking of pets and human figures, if a pet or human figure leaves the monitoring range, its corresponding detection is not performed, avoiding false alarms caused by a pedestrian leaving the monitoring range while their leashed pet remains within it, or by a pet leaving the monitoring range while its owner remains within it. Furthermore, this application allows for continuous 24 / 7 monitoring, recording and outputting captured images and alerts, avoiding the problems of untimely monitoring, missed detections, and difficulties in evidence collection inherent in manual monitoring.

[0058] Please see Figure 3 , Figure 3 This is a flowchart illustrating the specific method for detecting pet leashes in the embodiments of this application. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily reflect that. Figure 3 The illustrated process sequence is limited. Dogs are common pets; in this specific implementation, a dog is used as an example for explanation. Figure 3 As shown, in one specific embodiment, the pet leash detection method includes six modules: a dog detection module, a human detection module, a dog and human image matching and cropping module, a leash classification module, a tracking module, and a capture module.

[0059] First, real-time images of the monitored scene are acquired using a camera, and a coordinate system XY is established with the top-left corner of the image as the origin (0,0). The current frame image is used as the image to be detected and input into the dog detection module. The dog detection module uses the YOLO deep learning algorithm to detect whether the image contains dogs. If no dogs are detected, the image is directly output without further processing. If a dog is detected, a bounding box containing the dog is obtained, and the coordinates of the top-left and bottom-right corners of the bounding box are used as the bounding box coordinates. The bounding box coordinates of the dog's position are output, such as [(x1,y1),(x2,y2)], where the coordinates of the top-left corner of the dog detection box are (x1,y1) and the coordinates of the bottom-right corner are (x2,y2). The image to be detected is then input into the human detection module. In this embodiment, if a total of n dogs are detected, the output dog detection box coordinates are: [(x1,y1),(x2,y2)]. 11 ,y 11 ),(x 12 ,y 12 )]、 [(x 21 ,y 21 ),(x 22 ,y 22 )]、……[(x n1 ,y n1 ),(x n2 ,y n2 )).

[0060] The human detection module uses the YOLO deep learning algorithm to detect whether the image contains a human. If no human is detected, the image and the coordinates of the dog detection box are input into the capture module. If a human is detected, a rectangle containing the human is obtained. The coordinates of the upper left and lower right corners of the rectangle are used as the rectangle coordinates, and the rectangle coordinates of the human position are output, such as [(a1,b1),(a2,a2)]. Here, the upper left corner of the human detection box is (a1,b1), and the lower right corner is (a2,b2). The image, the dog detection box coordinates, and the human detection box coordinates are then input into the dog and human image matching and cropping module. In this embodiment, if m human bodies are detected, the output human detection box coordinates are: [(a1,b1),(a2,a2)]. 11 ,b 11 ),(a 12 ,b 12 )]、[(a 21 ,b 21 ),(a 22 ,b 22 )]、…… [(a m1 ,b m1 ),(a m2 ,b m2 Please see [link / reference]. Figure 4 , Figure 4This is a schematic diagram of a dog detection box and a human detection box in an embodiment of this application. The coordinates of the dog detection box obtained by detecting the dog and human are [x...]. 11 ,y 11 ),(x 12 ,y 12 The coordinates of the human detection box are [a], [b], [c], [d], [b], [c ... 11 ,b 11 ),(a12,b 12 )).

[0061] In the dog and human image matching and cropping module, the input dog detection boxes and human detection boxes are combined pairwise, and cropped according to the coordinates of the dog and human detection boxes to obtain a combined image containing both dog and human detection boxes. The resulting n dog detection boxes and m human detection boxes are combined to obtain n×m combined images. In one embodiment, the smallest image containing both dog and human detection boxes is cropped as the combined image. For details, please refer to [link to specific documentation]. Figure 5 , Figure 5 yes Figure 4 A schematic diagram of the combined image of the dog detection box and the human detection box. Compare the x-coordinate of the top-left corner of the dog detection box. 11 And the horizontal coordinate a of the top left corner of the human detection box 11 The size is determined by selecting the smallest x-coordinate as the x-coordinate of the top-left corner of the combined image, i.e., u. 11 =MIN(x 11 ,a 11 ); Compare the ordinate x of the top left corner of the dog detection box. 12 And the top left corner of the human detection box, y-coordinate a 12 The size is determined by selecting the smallest x-coordinate as the x-coordinate of the top-left corner of the combined image, i.e., u. 12 =MAX(x) 12 ,a 12 ); Compare the x-coordinate of the lower right corner of the dog detection box. 11 And the horizontal coordinate b of the bottom right corner of the human detection box 11 The size is determined by selecting the smallest x-coordinate as the x-coordinate of the top left corner of the combined image, i.e., v. 11 =MIN(y 11 ,b 11 ); Compare the y-coordinate of the lower right corner of the dog detection box. 12 And the bottom right corner of the human detection box, y-coordinate b 12 The size is determined by selecting the smallest x-coordinate as the x-coordinate of the top left corner of the combined image, i.e., v. 12 =MAX(y 12 ,b 12 Based on the obtained coordinates, the image to be detected is processed, and the coordinates of the combined image are [u]. 11 ,v11 ),(u 12 ,v 12 The resulting combined image is then input into the rope classification module.

[0062] The leash classification module first groups the combined images, grouping n combined images corresponding to the same dog into one group, and binding each group of combined images to the corresponding dog detection box. A convolutional neural network (CNN) is used to perform binary classification on each combined image, detecting whether the image belongs to the "leashed" or "unleashed" category. Selectable CNNs include, but are not limited to, AlexNet, ResNet, Inception series networks, VGG series networks, and networks improved upon these. When all n combined images corresponding to the same dog in a group are classified as "unleashed," the dog is determined to be "unleashed," the detection result is recorded, and the image to be detected and the dog detection box are input into the capture module. Conversely, when at least one of the n combined images corresponding to the same dog in a group is classified as "leashed," the dog is determined to be "leashed," and the dog detection box and the corresponding human detection box are input into the tracking module.

[0063] The capture module captures and saves the current frame image. Then, it overlays the detection boxes for dogs classified as "unleashed" onto the current frame image to create the final captured evidence image. This evidence image is then output along with a notification message to facility supervisors, enabling them to monitor the behavior of unleashed dogs.

[0064] In the tracking module, dogs and humans classified as "leashed" are tracked. Specifically, IDs are first assigned to the dogs and humans input into the tracking module, and IDs of the same group of dogs and humans are bound and marked. The target states of the dogs and humans are then marked, with three target states: "Target Created," "Target Updated," and "Target Hidden." The target state of the dogs and humans just input into the tracking module is marked as "Target Created." When the dogs and humans are active within the monitored area, the target state is marked as "Target Updated." Based on feature extraction and filtering search algorithms, target tracking is performed on dogs and humans in the "Target Created" and "Target Updated" states, and target information is continuously output. Feature extraction methods include, but are not limited to, methods based on local features, global features, templates, histograms, binary patterns, PCA, sparsePCA, SR (sparse representation), discriminative models, and generative models. Search mechanisms include, but are not limited to, CSK, KCF / DCF, CN, particle filtering, Markov chain Monte Carlo method, local optimum search, and dense sampling search. When a dog and / or human is detected leaving the monitored area, the corresponding dog and / or human is marked as "target hidden". When a human is in the "target hidden" state, the image of the corresponding dog will not be combined with other human bodies in subsequent monitoring video frames, i.e., leash detection will not be performed; or when a dog is in the "target hidden" state, the image of the corresponding human will not be combined with other dogs in subsequent monitoring video frames, i.e., leash detection will not be performed.

[0065] After the current frame image is processed, the above method is used to process subsequent monitoring video frame images.

[0066] In this specific implementation, deep learning algorithms are used to automatically detect dogs and people in the surveillance video, pairing them to determine whether they are leashed. This approach considers situations where the dog is leashed but the leash is detached from the person's hand, broadening the application scenarios and increasing accuracy. Simultaneously, values ​​indicating a leash and the person are marked to avoid subsequent detection, thus saving resources and reducing computational load. During subsequent tracking of dogs and people, if either a dog or person leaves the monitoring range, the corresponding person or dog is not detected, avoiding false alarms caused by pedestrians leaving the monitoring range while their leashed dogs remain within it, or by dogs leaving the monitoring range while their owners are still within it. Furthermore, this application allows for continuous 24 / 7 monitoring, recording and outputting captured images and alerts, avoiding the problems of untimely monitoring, missed detections, and difficulties in evidence collection inherent in manual monitoring.

[0067] Please see Figure 6 , Figure 6 This is a schematic diagram of the pet leash detection device according to an embodiment of this application. In this embodiment, the pet leash detection device includes an acquisition module 61, a detection module 62, a combination module 63, and an association module 64.

[0068] The device comprises several modules: an acquisition module 61 for acquiring the image to be detected; a detection module 62 for detecting pets and human figures in the image, acquiring the location coordinates of the pet and human figure upon detection; a combination module 63 for acquiring combined images, each containing a combination of any pet and any human figure, and identifying leashes in all combined images; and an association module 64 for marking and associating pets and human figures in the combined image upon the recognition result of the combined image indicating that the pet is leashed, and stopping the detection of pets with the association mark. This pet leash detection device automatically detects pets and human figures in surveillance videos, combining them in pairs to determine whether they are leashed. It not only determines whether the pet is leashed but also considers situations where the leash is loose from the person's hand, making the application scenarios more extensive and the accuracy higher. Simultaneously, marking pets and human figures identified as leashed avoids duplicate detection, saving resources and reducing computational load.

[0069] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of a pet leash detection device according to an embodiment of this application. In this embodiment, the pet leash detection device 71 includes a processor 72.

[0070] Processor 72 can also be referred to as a CPU (Central Processing Unit). Processor 72 may be an integrated circuit chip with signal processing capabilities. Processor 72 can also be a general-purpose processor, 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. A general-purpose processor can be a microprocessor, or processor 72 can be any conventional processor.

[0071] The pet leash detection device 71 may further include a memory (not shown) for storing instructions and data required for the processor 72 to run.

[0072] The processor 72 is used to execute instructions to implement the method provided by any embodiment and any non-conflicting combination of the pet leash detection method of this application.

[0073] Please see Figure 8 , Figure 8This is a schematic diagram of the structure of a computer-readable storage medium in an embodiment of this application. The computer-readable storage medium 81 in this embodiment stores instruction / program data 82. When executed, this instruction / program data 82 implements the method provided by any embodiment of the pet leash detection method of this application and any non-conflicting combination thereof. The instruction / program data 82 can be formed into a program file and stored in the aforementioned storage medium 81 in the form of a software product, so that a computer device (which may be a personal computer, server, or network device, etc.) or processor can execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium 81 includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or terminal devices such as computers, servers, mobile phones, and tablets.

[0074] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0075] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0076] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for detecting pet leashes, characterized in that, The method includes: Acquire the image to be detected; The image to be detected is subjected to pet and human detection. In response to the detection of pet and human, the position coordinates of the pet and the position coordinates of the human are obtained. A combined image is obtained based on the pet's location coordinates and the human figure's location coordinates. Each combined image includes a combination of any pet and any human figure. Leash recognition is performed on all combined images. In response to the recognition result of the combined image being that the pet is on a leash, the pet and the human figure in the combined image are marked and associated, and the detection of the leash for the pet with the associated mark is stopped. The step of suspending leash detection of pets with associated tags includes: tracking the pets and humanoids with associated tags separately; in response to the humanoids with associated tags leaving the monitoring area, ceasing to combine the images of the pets with associated tags with other humanoids; and / or in response to the pets with associated tags leaving the monitoring area, ceasing to combine the images of the humanoids with associated tags with other pets.

2. The pet leash detection method according to claim 1, characterized in that, The tracking of the pets and humanoid figures with associated tags includes: The pets and humanoids with associated tags are tracked based on feature extraction and search algorithms.

3. The pet leash detection method according to claim 1, characterized in that, A coordinate system is established with the coordinates of the top-left corner vertex of the image to be detected as the origin. The step of detecting pets and human figures in the image to be detected, and obtaining the pet's position coordinates and the human figure's position coordinates in response to the detection of pets and human figures, includes: Obtain a pet region image, which is a rectangular region image containing the pet, and use the combination of the coordinates of the top left corner vertex and the bottom right corner vertex of the pet region image as the position coordinates of the pet; A human-shaped region image is obtained, wherein the human-shaped region image is a rectangular region image containing the human shape, and the combination of the coordinates of the upper left corner vertex and the lower right corner vertex of the human-shaped region image is used as the position coordinates of the human shape.

4. The pet leash detection method according to claim 3, characterized in that, The acquisition of the combined image includes: Compare the top-left corner x-coordinate of the pet region image with the top-left corner x-coordinate of the human region image, and use the smaller one as the top-left corner x-coordinate of the combined image; Compare the top-left ordinate of the pet region image with the top-left ordinate of the human region image, and use the smaller one as the top-left ordinate of the combined image; Compare the lower right corner x-coordinate of the pet area image with the lower right corner x-coordinate of the human area image, and use the larger one as the lower right corner x-coordinate of the combined image; Compare the lower right corner ordinate of the pet region image with the lower right corner ordinate of the human region image, and use the larger one as the lower right corner ordinate of the combined image.

5. The pet leash detection method according to claim 1, characterized in that, A convolutional neural network is used to identify whether the human figures and pets in the combined images are on leashes; The convolutional neural network includes any one or a combination of AlexNet, ResNet, Inception, and VGG.

6. The pet leash detection method according to claim 1, characterized in that, In response to detecting a pet and not a human figure, the system acquires a pet area image and outputs the image corresponding to a pet that is not on a leash; or If a pet is detected as being unleashed in multiple combined images corresponding to the same pet, the system outputs that the pet is unleashed.

7. The pet leash detection method according to claim 6, characterized in that, In response to detecting that a pet is not on a leash, the system outputs an image of the area where the pet is not on a leash and the image to be detected, and provides an information reminder.

8. A pet leash detection device, characterized in that, Includes a processor, the processor being configured to execute instructions to implement the pet leash detection method as described in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store instruction / program data that can be executed to implement the pet leash detection method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Behavior recognition method and device and computer readable storage medium

    CN110738101A

  • Pet tracking method based on local feature recognition and adjacent frame matching in community monitoring scene

    CN112307897A

  • Illegal dog walking event detection method and device based on monitoring video

    CN112906678A