A method and related device for managing companionship objects based on image recognition

By using image recognition technology to identify the distance between pets and their companions, the effectiveness of pet management has been improved, preventing pet-related injuries from occurring.

CN114445645BActive Publication Date: 2026-01-30NEW RUIPENG PET HEALTHCARE GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111584159.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2026-01-30
Estimated Expiration
2041-12-22

AI Technical Summary

Technical Problem

Existing pet management methods are not very effective and cannot effectively prevent pets from injuring people.

Method used

By using image recognition technology to acquire images to be recognized, the distance between the first and second objects can be identified, and the second object can be managed based on the distance, thus achieving effective pet management.

Benefits of technology

It improves the effectiveness of pet management and avoids the inefficiency of manual management after pet-related incidents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114445645B_ABST
    Figure CN114445645B_ABST
Patent Text Reader

Abstract

This application discloses a companion object management method and related apparatus based on image recognition. The method includes: acquiring an image to be recognized; recognizing the image to be recognized to obtain a first object and a second object in the image, wherein the first object is a companion object of the second object; determining the distance between the first object and the second object in the image to be recognized; and prompting the second object to manage the first object based on the distance between the first object and the second object. Implementing the embodiments of this application improves the effectiveness of pet management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method and related apparatus for managing companionship objects based on image recognition. Background Technology

[0002] With the development of the times, keeping pets has become a hobby for people to get closer to nature and satisfy their psychological needs. Keeping pets can bring joy, but it can also bring trouble. For example, more active pets like dogs need outdoor activity. Therefore, people need to walk their pets. However, there is a risk of pets injuring people during walks. To avoid such problems, pet management is necessary. However, the effectiveness of current pet management systems is low. Summary of the Invention

[0003] This application provides a method and related apparatus for managing companion animals based on image recognition, thereby improving the effectiveness of pet management.

[0004] The first aspect of this application provides a companion object management method based on image recognition, including:

[0005] Acquire the image to be recognized;

[0006] The image to be identified is then identified to obtain a first object and a second object in the image to be identified, wherein the first object is a companion object of the second object;

[0007] Determine the distance between the first object and the second object in the image to be identified;

[0008] Based on the distance between the first object and the second object, the second object is prompted to manage the first object.

[0009] A second aspect of this application provides a companion object management device based on image recognition, the device comprising an acquisition module, a recognition module, a determination module, and a prompting module.

[0010] The acquisition module is used to acquire the image to be recognized;

[0011] The recognition module is used to recognize the image to be recognized in order to obtain a first object and a second object in the image to be recognized, wherein the first object is a companion object of the second object;

[0012] The determining module is used to determine the distance between the first object and the second object in the image to be identified;

[0013] The prompting module is used to prompt the second object to manage the first object based on the distance between the first object and the second object.

[0014] A third aspect of this application provides an electronic device for managing companion objects based on image recognition, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and are generated and executed by the processor to perform steps in any one of the methods of a companion object management method based on image recognition.

[0015] A fourth aspect of this application provides a computer-readable storage medium for storing a computer program, which is executed by the processor to implement any one of the methods described in the image recognition-based companion object management method.

[0016] As can be seen, the above technical solution acquires an image to be identified, which then allows for the identification of a first object and a second object within that image. Furthermore, based on the distance between the first and second objects, the second object is prompted to manage the first object. This effectively improves the efficiency of pet management by providing advance notice of the distance between the two objects. In other words, it avoids the problem of low effectiveness in manual pet management after incidents such as pet attacks. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] in:

[0019] Figure 1A This is a schematic diagram of a companion object management system based on image recognition provided in an embodiment of this application;

[0020] Figure 1B This is a schematic diagram of another image recognition-based companion management system provided in an embodiment of this application;

[0021] Figure 2 This is a flowchart illustrating a companion object management method based on image recognition provided in an embodiment of this application;

[0022] Figure 3 This is a flowchart illustrating another image recognition-based companion object management method provided in an embodiment of this application;

[0023] Figure 4 A schematic diagram of a companion object management device based on image recognition provided in an embodiment of this application;

[0024] Figure 5 This is a schematic diagram of the electronic device structure of the hardware operating environment involved in the embodiments of this application. Detailed Implementation

[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0026] The following sections will provide detailed explanations.

[0027] The terms "first" and "second" in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.

[0028] First, see Figure 1A , Figure 1A This is a schematic diagram of an image recognition-based companion object management system provided in an embodiment of this application. The image recognition-based companion object management system 100 may include an image recognition-based companion object management device 110. The image recognition-based companion object management device 110 is used to process and store images to be recognized, etc. The image recognition-based companion object management system 100 may include an integrated single device or multiple devices. For ease of description, this application refers to the image recognition-based companion object management system 100 as an electronic device. Obviously, this electronic device may include various handheld devices with wireless communication functions, in-vehicle devices, wearable devices, computing devices or other processing devices connected to a wireless modem, as well as various forms of user equipment (UE), mobile station (MS), terminal device, etc.

[0029] See Figure 1B , Figure 1B This is a schematic diagram of another image recognition-based companion management system provided in an embodiment of this application. For example... Figure 1B As shown, the communication system may include a server and multiple electronic devices. Figure 1B (Only 3 are shown in the image). Servers can communicate wirelessly with electronic devices.

[0030] in, Figure 1A and Figure 1B This is merely an illustrative diagram and does not constitute a limitation on the applicable scenarios of the technical solutions provided in this application.

[0031] See Figure 2 , Figure 2 This is a flowchart illustrating a companion object management method based on image recognition, provided in an embodiment of this application. This image recognition-based companion object management method can be applied to electronic devices, such as… Figure 2 As shown, the method includes:

[0032] 201. Obtain the image to be recognized.

[0033] Optionally, the number of images to be identified can be one or more, and there is no limitation here. If there are multiple images to be identified, the images to be identified can include multiple consecutive frames, each frame including at least one first candidate object and at least one second candidate object. It is understood that a first candidate object is a companion object to a second candidate object.

[0034] For example, a first candidate is a pet, and a second candidate is a human.

[0035] 202. Recognize the image to be recognized to obtain the first object and the second object in the image to be recognized, wherein the first object is the companion object of the second object.

[0036] The first object is the pet, and the second object is the pet's owner.

[0037] Optionally, step 202 may include: obtaining a first mask image and a second mask image corresponding to the image to be identified; determining at least one first candidate object in the image to be identified based on the first mask image; determining at least one second candidate object in the image to be identified based on the second mask image; determining movement data of at least one first candidate object and movement data of at least one second candidate object based on the first mask image and the second mask image; and determining a first object and a second object based on the movement data of at least one first candidate object and the movement data of at least one second candidate object.

[0038] In this mask, the pixels in the first mask and the second mask include first pixels and second pixels. It can be understood that in the first mask, at least one pixel corresponding to a first candidate object is the first pixel, and the remaining pixels are second pixels; in the second mask, at least one pixel corresponding to a second candidate object is the first pixel, and the remaining pixels are second pixels. The first pixel and the second pixel are different.

[0039] For example, the first pixel is 1 and the second pixel is 0.

[0040] The movement data of a first candidate object includes at least one of the following: the distance between the first candidate object and at least one second candidate object in the image to be identified, and the direction of movement of the first candidate object. The movement data of a second candidate object includes at least one of the following: the distance between the second candidate object and at least one first candidate object in the image to be identified, and the direction of movement of the second candidate object.

[0041] As can be seen, in the above technical solution, by obtaining the first mask image and the second mask image corresponding to the image to be identified, at least one first candidate object in the image to be identified can be determined according to the first mask image, and at least one second candidate object in the image to be identified can be determined according to the second mask image. Then, the movement data of at least one first candidate object and the movement data of at least one second candidate object can be obtained. Based on the movement data of at least one first candidate object and the movement data of at least one second candidate object, the first object and the second object can be determined. This achieves accurate determination of the first object from at least one first candidate object and determination of the second object from at least one second candidate object.

[0042] Optionally, in this application, determining the movement data of at least one first candidate object and the movement data of at least one second candidate object based on the first mask image and the second mask image can be understood in any of the following ways, without limitation herein.

[0043] Method 1: The movement data of a first candidate object includes the distance between the first candidate object and at least one second candidate object in the image to be identified; the movement data of a second candidate object includes the distance between the second candidate object and at least one first candidate object in the image to be identified. Based on a first mask image, a first center pixel of each first candidate object in the image to be identified is determined; based on a second mask image, a second center pixel of each second candidate object in the image to be identified is determined; based on the first center pixel and the second center pixel, the distance between any first candidate object and at least one second candidate object in the image to be identified, and the distance between any second candidate object and at least one first candidate object, are determined. That is, it can be seen that the above technical solution achieves accurate determination of the distance between any first candidate object and at least one second candidate object in the image to be identified based on the first center pixel and the second center pixel.

[0044] Method 2: The movement data of a first candidate object includes the direction of travel of the first candidate object, and the movement data of a second candidate object includes the direction of travel of the second candidate object; the image to be identified includes multiple consecutive frames, each frame including at least one first candidate object and at least one second candidate object, each frame corresponding to a first mask sub-image in a first mask image and a second mask sub-image in a second mask image; based on each first mask sub-image, the orientation of at least one first candidate object in each frame is determined; based on each second mask sub-image, the orientation of at least one second candidate object in each frame is determined; based on the orientation of at least one first candidate object in each frame, the direction of travel of at least one first candidate object is determined; based on the orientation of at least one second candidate object in each frame, the direction of travel of at least one second candidate object is determined. That is, it can be seen that the above technical solution achieves accurate determination of the direction of travel of candidate objects based on their orientation.

[0045] Wherein, the first center pixel is the center point of an image block with a first preset size in the image to be identified, and the image block with the first preset size in the image to be identified is determined according to the location of each first candidate object, and the location of each first candidate object is determined according to the first mask image; the second center pixel is the center point of an image block with a second preset size in the image to be identified, and the image block with the second preset size in the image to be identified is determined according to the location of each second candidate object, and the location of each second candidate object is determined according to the second mask image.

[0046] Optionally, for method 1, determining the first object and the second object based on the movement data of at least one first candidate object and at least one second candidate object includes: selecting the first candidate object whose distance between the first candidate object and at least one second candidate object falls within a preset distance range as the first object; and selecting the second candidate object whose distance between the second candidate object and at least one first candidate object falls within a preset distance range as the second object. That is, it can be seen that the above technical solution achieves accurate determination of the first object and the second object based on the distance between different candidate objects.

[0047] The preset distance range can be configured in the electronic device or configured by the server for the electronic device; there is no limitation here.

[0048] The orientation of the first candidate object can be understood as the orientation of the face of the first candidate object; the orientation of the second candidate object can be understood as the orientation of the face of the second candidate object.

[0049] Optionally, determining the orientation of at least one first candidate object in each frame image based on each first mask sub-image includes: determining the head region of at least one first candidate object in each frame image based on each first mask sub-image; obtaining the proportion of the third pixel of the head region of any first candidate object in each frame image; and determining the orientation of at least one first candidate object in each frame image based on the proportion of the third pixel of the head region of any first candidate object. That is, it can be seen that the above technical solution achieves accurate determination of the orientation of at least one first candidate object in each frame image.

[0050] The third pixel is the average value of pixels in at least one part of the head region of any first candidate object, and the at least one part may include at least one of the following: eyes, nose, and mouth.

[0051] Specifically, if the proportion of the third pixel in the head region of any first candidate object is higher than the first proportion, then at least one first candidate object in each frame is facing the shooting direction; if the proportion of the third pixel in the head region of any first candidate object is less than or equal to the first proportion and greater than the second proportion, then at least one first candidate object in each frame is facing a first angle relative to the shooting direction; if the proportion of the third pixel in the head region of any first candidate object is less than or equal to the second proportion and greater than the third proportion, then at least one first candidate object in each frame is facing sideways to the shooting direction; if the proportion of the third pixel in the head region of any first candidate object is less than or equal to the third proportion, then at least one first candidate object in each frame is facing away from the shooting direction.

[0052] The first to third percentages can be configured in electronic devices or configured by the server for electronic devices; no limitation is made here.

[0053] Optionally, the orientation of at least one second candidate object in each frame is determined based on the distribution areas of the fourth and fifth pixels of the head region of at least one second candidate object in each frame, and the head region of at least one second candidate object in each frame is determined based on each second mask sub-image. Specifically, the fourth pixel of the head region of at least one second candidate object in each frame is the average value of the pixels of the face of at least one second candidate object in each frame, and the fifth pixel of the head region of at least one second candidate object in each frame is the average value of the pixels in the head region of at least one second candidate object excluding the face.

[0054] Specifically, if the ratio between the distribution area of ​​the fourth pixel and the distribution area of ​​the fifth pixel is greater than a first ratio, then at least one second candidate object in each frame is oriented directly towards the shooting direction; if the ratio between the distribution area of ​​the fourth pixel and the distribution area of ​​the fifth pixel is less than or equal to the first ratio and greater than a third ratio, then at least one second candidate object in each frame is oriented at a second angle relative to the shooting direction; if the ratio between the distribution area of ​​the fourth pixel and the distribution area of ​​the fifth pixel is less than or equal to the third ratio and greater than a fourth ratio, then at least one second candidate object in each frame is oriented sideways towards the shooting direction; if the ratio between the distribution area of ​​the fourth pixel and the distribution area of ​​the fifth pixel is less than or equal to the fourth ratio, then at least one second candidate object in each frame is oriented away from the shooting direction.

[0055] Specifically, if the ratio between the distribution area of ​​the fourth pixel and the distribution area of ​​the fifth pixel is less than or equal to the third ratio and greater than the fourth ratio, and the distribution area of ​​the fourth pixel is on the left, then the orientation of at least one second candidate object in each frame is to the right facing the shooting direction; if the ratio between the distribution area of ​​the fourth pixel and the distribution area of ​​the fifth pixel is less than or equal to the third ratio and greater than the fourth ratio, and the distribution area of ​​the fourth pixel is on the right, then the orientation of at least one second candidate object in each frame is to the left facing the shooting direction.

[0056] Optionally, determining the travel direction of at least one first candidate object based on the orientation of at least one first candidate object in each frame image includes: for one of the at least one first candidate object, if the orientations of the first candidate objects in the target image are consistent, then the orientation of the first candidate object in any frame of the target image is taken as the travel direction of the first candidate object; wherein, the target image is an image exceeding a preset number of frames in a multi-frame image. That is, it can be seen that the above technical solution achieves accurate determination of the travel direction of the candidate object.

[0057] The preset frame rate can be configured in the electronic device or configured by the server for the electronic device; there is no limitation on this.

[0058] The requirement that the orientation of the first candidate objects in the target image is consistent can be understood as: the deviation in the orientation of the first candidate objects in different images of the target image is within a preset orientation range. This preset orientation range can be configured in the electronic device or configured by the server for the electronic device; no limitation is made here.

[0059] For example, the multi-frame images can be images with 3 frames, and the preset orientation range is [-30°, 30°]. If the orientation of the first candidate object in one frame is directly facing the shooting direction, the orientation of the first candidate object in another frame is 10 degrees away from the shooting direction, and the orientation of the first candidate object in yet another frame is facing away from the shooting direction, it can be seen that the deviation between directly facing the shooting direction and 10 degrees away from the shooting direction is -10 degrees. Therefore, in 2 out of the 3 images, the orientation of the first candidate object is the same. In this case, the orientation of directly facing the shooting direction or 10 degrees away from the shooting direction can be taken as the direction of travel of the first candidate object.

[0060] Optionally, determining the travel direction of at least one second candidate object based on the orientation of at least one second candidate object in each frame image includes: for one of the at least one second candidate object, if the orientations of the second candidate objects in the target image are consistent, then the orientation of the second candidate object in any frame of the target image is taken as the travel direction of the second candidate object; wherein, the target image is an image exceeding a preset number of frames in a multi-frame image. That is, it can be seen that the above technical solution achieves accurate determination of the travel direction of the candidate object.

[0061] The fact that the orientation of the second candidate objects in the target image is consistent can be understood as: the deviation of the orientation of the second candidate objects in different images of the target image is within a preset orientation range.

[0062] Optionally, for method 2, determining the first object and the second object based on the movement data of at least one first candidate object and at least one second candidate object includes: determining first and second candidate objects with the same movement direction based on the movement direction of at least one first candidate object and at least one second candidate object; and designating the first and second candidate objects with the same movement direction as the first object and the second object, respectively. That is, it can be seen that the above technical solution achieves accurate determination of the first and second objects.

[0063] Among them, the first candidate object and the second candidate object with the same direction of travel can be understood as: the first candidate object and the second candidate object whose direction of travel is within the preset direction of travel.

[0064] 203. Determine the distance between the first object and the second object in the image to be identified.

[0065] The distance between the first object and the second object can be understood as the distance between the first center pixel of the first object in the image to be identified and the second center pixel of the second object in the image to be identified.

[0066] 204. Based on the distance between the first object and the second object, prompt the second object to manage the first object.

[0067] Optionally, step 204 may include: if the distance between the first object and the second object is greater than or equal to a preset distance, then prompting the second object to manage the first object, such as sending a prompt message to the second object to prompt the second object to manage the first object.

[0068] The preset distance can be configured in the electronic device or configured by the server for the electronic device; there is no limitation here.

[0069] As can be seen, the above technical solution acquires an image to be identified, which then allows for the identification of a first object and a second object within that image. Furthermore, based on the distance between the first and second objects, the second object is prompted to manage the first object. This effectively improves the efficiency of pet management by providing advance notice of the distance between the two objects. In other words, it avoids the problem of low effectiveness in manual pet management after incidents such as pet attacks.

[0070] See Figure 3 , Figure 3 This is a flowchart illustrating another image recognition-based companion management method provided in this application embodiment. This image recognition-based companion management method can be applied to electronic devices, such as... Figure 3 As shown, the method includes:

[0071] 301. Obtain the image to be recognized.

[0072] Among them, step 301 and Figure 2 Step 201 is similar and will not be repeated here.

[0073] 302. Obtain the first mask image and the second mask image corresponding to the image to be recognized.

[0074] Step 302 can be referred to Figure 2 The relevant description of step 202 will not be repeated here.

[0075] 303. Based on the first mask image, determine at least one first candidate object in the image to be identified.

[0076] Step 303 can be referred to Figure 2 The relevant description of step 202 will not be repeated here.

[0077] 304. Based on the second mask image, determine at least one second candidate object in the image to be identified.

[0078] Step 304 can be referred to Figure 2 The relevant description of step 202 will not be repeated here.

[0079] 305. Based on the first mask image and the second mask image, determine the movement data of at least one first candidate object and the movement data of at least one second candidate object.

[0080] Step 305 can be referred to Figure 2 The relevant description of step 202 will not be repeated here.

[0081] 306. Determine the first object and the second object based on the movement data of at least one first candidate object and the movement data of at least one second candidate object.

[0082] Step 306 can be referred to Figure 2 The relevant description of step 202 will not be repeated here.

[0083] 307. Determine the distance between the first object and the second object in the image to be identified.

[0084] Among them, step 307 and Figure 2 Step 203 is similar and will not be repeated here.

[0085] 308. Based on the distance between the first object and the second object, prompt the second object to manage the first object.

[0086] Among them, step 308 and Figure 2 Step 204 is similar and will not be repeated here.

[0087] As can be seen, the above technical solution accurately identifies the first object from at least one first candidate object, and the second object from at least one second candidate object. Simultaneously, it also uses the distance between the first and second objects to proactively prompt the second object to manage the first object, thus improving the effectiveness of pet management. In other words, it avoids the problem of low effectiveness in manual pet management after incidents such as pet attacks on people.

[0088] See Figure 4 , Figure 4 This is a schematic diagram of a companion object management device based on image recognition, provided as an embodiment of this application. Wherein, as... Figure 4 As shown in the figure, the companion object management device 400 based on image recognition provided in this application embodiment includes an acquisition module 401, an identification module 402, a determination module 403, and a prompting module 404.

[0089] The acquisition module 401 is used to acquire the image to be identified; the identification module 402 is used to identify the image to be identified in order to obtain the first object and the second object in the image to be identified, wherein the first object is the companion object of the second object; the determination module 403 is used to determine the distance between the first object and the second object in the image to be identified; and the prompting module 404 is used to prompt the second object to manage the first object based on the distance between the first object and the second object.

[0090] Optionally, when recognizing the image to be recognized to obtain the first object and the second object in the image, the recognition module 402 is specifically used for:

[0091] Obtain a first mask image and a second mask image corresponding to the image to be identified; determine at least one first candidate object in the image to be identified based on the first mask image; determine at least one second candidate object in the image to be identified based on the second mask image; determine the movement data of at least one first candidate object and the movement data of at least one second candidate object based on the first mask image and the second mask image; determine the first object and the second object based on the movement data of at least one first candidate object and the movement data of at least one second candidate object.

[0092] Optionally, the movement data of a first candidate object includes the distance between the first candidate object and at least one second candidate object in the image to be identified, and the movement data of a second candidate object includes the distance between the second candidate object and at least one first candidate object in the image to be identified; when determining the movement data of at least one first candidate object and at least one second candidate object based on the first mask image and the second mask image, the identification module 402 is specifically used for:

[0093] Based on the first mask image, determine the first center pixel of each first candidate object in the image to be identified; based on the second mask image, determine the second center pixel of each second candidate object in the image to be identified; based on the first center pixel and the second center pixel, determine the distance between any first candidate object and at least one second candidate object in the image to be identified, and the distance between any second candidate object and at least one first candidate object.

[0094] Optionally, when determining the first object and the second object based on the movement data of at least one first candidate object and the movement data of at least one second candidate object, the identification module 402 is specifically used for:

[0095] The first candidate object is defined as the first object whose distance between the first candidate object and at least one second candidate object falls within a preset distance range; the second candidate object is defined as the second object whose distance between the second candidate object and at least one first candidate object falls within a preset distance range.

[0096] Optionally, the image to be identified includes multiple consecutive frames, each frame including at least one first candidate object and at least one second candidate object, each frame corresponding to a first mask sub-image in a first mask image and a second mask sub-image in a second mask image; when determining the movement data of at least one first candidate object and at least one second candidate object based on the first mask image and the second mask image, the identification module 402 is specifically used for:

[0097] Based on each first mask sub-image, the orientation of at least one first candidate object in each frame image is determined; based on each second mask sub-image, the orientation of at least one second candidate object in each frame image is determined; based on the orientation of at least one first candidate object in each frame image, the travel direction of at least one first candidate object is determined; based on the orientation of at least one second candidate object in each frame image, the travel direction of at least one second candidate object is determined; wherein, the movement data of a first candidate object includes the travel direction of the first candidate object, and the movement data of a second candidate object includes the travel direction of the second candidate object.

[0098] Optionally, when determining the travel direction of at least one first candidate object based on the orientation of at least one first candidate object in each frame image, the recognition module 402 is specifically used for:

[0099] For one of the at least one first candidate objects, if the orientations of the first candidate objects in the target image are consistent, then the orientation of the first candidate object in any frame of the target image is taken as the direction of travel of the first candidate object; wherein, the target image is an image in multiple frames that exceeds a preset number of frames.

[0100] Optionally, when determining the first object and the second object based on the movement data of at least one first candidate object and the movement data of at least one second candidate object, the identification module 402 is specifically used for:

[0101] Based on the travel direction of at least one first candidate object and the travel direction of at least one second candidate object, determine the first candidate object and the second candidate object with the same travel direction; and designate the first candidate object and the second candidate object with the same travel direction as the first object and the second object, respectively.

[0102] See Figure 5 , Figure 5 This is a schematic diagram of the electronic device structure of the hardware operating environment involved in the embodiments of this application.

[0103] This application provides an electronic device for companion object management based on image recognition, including a processor, a memory, a communication interface, and one or more programs. The one or more programs are stored in the memory and configured to be executed by the processor to perform instructions including steps from any of the image recognition-based companion object management methods. Figure 5 As shown, the electronic device of the hardware operating environment involved in the embodiments of this application may include:

[0104] Processor 501, such as CPU.

[0105] Memory 502, optionally, can be high-speed RAM or stable memory, such as disk storage.

[0106] Communication interface 503 is used to realize the connection and communication between processor 501 and memory 502.

[0107] Those skilled in the art will understand that Figure 5 The structure of the electronic device shown is not intended to limit it and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0108] like Figure 5As shown, the memory 502 may include an operating system, a network communication module, and one or more programs. The operating system is a program that manages and controls server hardware and software resources, supporting the execution of one or more programs. The network communication module is used to enable communication between the various components within the memory 502, as well as communication with other hardware and software within the electronic device.

[0109] exist Figure 5 In the illustrated electronic device, processor 501 executes one or more programs stored in memory 502 to perform the following steps:

[0110] Acquire the image to be recognized;

[0111] The image to be identified is identified to obtain a first object and a second object in the image, where the first object is a companion object of the second object;

[0112] Determine the distance between the first object and the second object in the image to be identified;

[0113] Based on the distance between the first object and the second object, prompt the second object to manage the first object.

[0114] For specific implementations of the electronic devices involved in this application, please refer to the various embodiments of the above-described image recognition-based companion object management method, which will not be repeated here.

[0115] This application also provides a computer-readable storage medium for storing a computer program, which is executed by a processor to perform the following steps:

[0116] Acquire the image to be recognized;

[0117] The image to be identified is identified to obtain a first object and a second object in the image, where the first object is a companion object of the second object;

[0118] Determine the distance between the first object and the second object in the image to be identified;

[0119] Based on the distance between the first object and the second object, prompt the second object to manage the first object.

[0120] For specific implementations of the computer-readable storage medium involved in this application, please refer to the various embodiments of the above-described image recognition-based companion object management method, which will not be repeated here.

[0121] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0122] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. An image recognition-based companion object management method, characterized by, The method comprises: acquiring a to-be-recognized image; recognizing the to-be-recognized image to obtain a first object and a second object in the to-be-recognized image, the first object being a companion object of the second object; determining a distance between the first object and the second object in the to-be-recognized image; prompting the second object to manage the first object according to the distance between the first object and the second object; the recognizing the to-be-recognized image to obtain the first object and the second object in the to-be-recognized image comprises: acquiring a first mask graph and a second mask graph corresponding to the to-be-recognized image; determining at least one first candidate object in the to-be-recognized image according to the first mask graph; determining at least one second candidate object in the to-be-recognized image according to the second mask graph; determining movement data of at least one first candidate object and movement data of at least one second candidate object according to the first mask graph and the second mask graph; and determining the first object and the second object according to the movement data of at least one first candidate object and the movement data of at least one second candidate object.

2. The method of claim 1, wherein, The movement data of one first candidate object comprises a distance between the first candidate object and at least one second candidate object in the to-be-recognized image, and the movement data of one second candidate object comprises a distance between the second candidate object and at least one first candidate object in the to-be-recognized image; the determining the movement data of at least one first candidate object and the movement data of at least one second candidate object according to the first mask graph and the second mask graph comprises: determining a first center pixel point of each first candidate object in the to-be-recognized image according to the first mask graph; determining a second center pixel point of each second candidate object in the to-be-recognized image according to the second mask graph; determining distances between any one first candidate object and at least one second candidate object in the to-be-recognized image and distances between any one second candidate object and at least one first candidate object according to the first center pixel point and the second center pixel point.

3. The method according to claim 1 or 2, characterized in that, The determining the first object and the second object according to the movement data of at least one first candidate object and the movement data of at least one second candidate object comprises: taking a first candidate object corresponding to a distance within a preset distance range as the first object; taking a second candidate object corresponding to a distance within the preset distance range as the second object.

4. The method of claim 1, wherein, The to-be-recognized image comprises a plurality of continuous images, each image comprising at least one first candidate object and at least one second candidate object, and each image corresponding to a first mask subgraph in the first mask graph and a second mask subgraph in the second mask graph; The determining of the movement data of at least one first candidate object and the movement data of at least one second candidate object according to the first mask graph and the second mask graph comprises: determining the orientation of at least one first candidate object in each frame of image according to each first mask subgraph; determining the orientation of at least one second candidate object in each frame of image according to each second mask subgraph; determining the moving direction of at least one first candidate object according to the orientation of at least one first candidate object in each frame of image; determining the moving direction of at least one second candidate object according to the orientation of at least one second candidate object in each frame of image; The movement data of one first candidate object comprises the moving direction of the first candidate object, and the movement data of one second candidate object comprises the moving direction of the second candidate object.

5. The method of claim 4, wherein, The determining of the moving direction of at least one first candidate object according to the orientation of at least one first candidate object in each frame of image comprises: if the orientation of one first candidate object in a target image is consistent, taking the orientation of the first candidate object in any frame of image in the target image as the moving direction of the first candidate object, for one first candidate object in at least one first candidate object; The target image is an image with more than a preset number of frames in the plurality of frames of image.

6. The method according to claim 1 or 4 or 5, characterized in that, The determining of the first object and the second object according to the movement data of at least one first candidate object and the movement data of at least one second candidate object comprises: determining first candidate objects and second candidate objects with the same moving direction according to the moving direction of at least one first candidate object and the moving direction of at least one second candidate object; taking the first candidate objects and the second candidate objects with the same moving direction as the first object and the second object respectively.

7. An image recognition-based companion management apparatus characterized by comprising: The device comprises an acquisition module, an identification module, a determination module and a prompt module, The acquisition module is configured to acquire a to-be-identified image. The identification module is configured to identify the to-be-identified image to obtain a first object and a second object in the to-be-identified image, the first object being a companion object of the second object. The determination module is configured to determine a distance between the first object and the second object in the to-be-identified image. The prompt module is configured to prompt the second object to manage the first object according to the distance between the first object and the second object. When identifying the to-be-identified image to obtain the first object and the second object in the to-be-identified image, the identification module is specifically configured to: acquire a first mask graph and a second mask graph corresponding to the to-be-identified image; and determine at least one first candidate object in the to-be-identified image according to the first mask graph. determine at least one second candidate object in the to-be-identified image according to the second mask graph. determine movement data of at least one of the first candidate objects and movement data of at least one of the second candidate objects according to the first mask image and the second mask image; determine the first object and the second object according to the movement data of at least one of the first candidate objects and the movement data of at least one of the second candidate objects. 8.An electronic device for companion object management based on image recognition, comprising: A computer program product, comprising a computer readable storage medium having stored thereon instructions that, when executed by a computer, cause the computer to perform the steps of any one of the preceding claims.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium is used to store a computer program, and the computer program is executed by a processor to implement the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Image identification method and apparatus

    CN107844794A

  • Object recognition method and device in image

    CN109117845A