Nose print image acquisition method, device, storage medium and electronic device
By collecting the pet's facial video and determining the video frames that meet the preset conditions, it solves the problem of illegal and time-consuming pet nose print pictures, achieves fast and accurate nose print acquisition, and improves the success rate of pet identification. and efficiency.
Patent Information
- Application Number
- CN202210173883.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-23
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-02-23
AI Technical Summary
In the existing technology, taking pictures of pet nose prints is illegal, time-consuming, and inaccurate, resulting in difficulties in pet medical care and anti-lost management.
By collecting the facial video of the target animal, the target video frame that meets the preset conditions is determined. The video frame includes facial information and nose information, and uses it as a nose print picture to quickly obtain the nose print picture.
It improves the success rate and efficiency of nose print entry and identification, and ensures the accuracy and speed of pet identification.
Smart Images

Figure CN114639141B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent recognition technology, and in particular to a method, device, storage medium and electronic device for obtaining a nose print image. Background Art
[0002] With the increase in the number of people keeping pets, various online pet management modes have been launched to help users solve problems such as pet medical care and pet loss prevention. Among the various modes, pet nose print entry and recognition are very important links. How to quickly and accurately take pictures of pet's nose prints is the key prerequisite for nose print entry and recognition. Summary of the invention
[0003] The embodiments of this specification provide a method, device, storage medium and electronic device for obtaining nose print images, which can quickly obtain nose print images of target animals based on video. The technical solution is as follows:
[0004] In a first aspect, an embodiment of the present specification provides a method for obtaining a nose print image, the method comprising:
[0005] Collect a video of the target animal’s face;
[0006] Determine a target video frame in the facial video, the target video frame including facial information and nose information of the target animal, the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the target video frame satisfies a third preset condition;
[0007] The target video frame is used as the nose print picture of the target animal.
[0008] In a second aspect, an embodiment of the present specification provides a device for acquiring a nose print image, wherein the device for acquiring a target nose print image comprises:
[0009] A video acquisition module is used to collect facial videos of target animals;
[0010] A video frame determination module, used to determine a target video frame in the facial video, wherein the target video frame includes facial information and nose information of the target animal, the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the target video frame satisfies a third preset condition;
[0011] The nose print picture determination module is used to use the target video frame as the nose print picture of the target animal.
[0012] In a third aspect, an embodiment of the present specification provides a storage medium, wherein the storage medium stores at least one instruction, and the at least one instruction is suitable for being loaded by a processor and executing the above-mentioned method steps.
[0013] In a fourth aspect, an embodiment of the present specification provides an electronic device, which may include: a processor and a memory; wherein the memory stores at least one instruction, and the at least one instruction is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0014] The beneficial effects brought by the technical solutions provided by some embodiments of this specification include at least:
[0015] By adopting the nose print image acquisition method provided in the embodiments of this specification, by collecting the facial video of the target animal, a target video frame is determined in the facial video, the target video frame includes the facial information and nose information of the target animal, the facial information satisfies the first preset condition, the nose information satisfies the second preset condition, and the blurriness of the target video frame satisfies the third preset condition. Finally, the target video frame is used as the nose print image of the target animal, thereby realizing the rapid acquisition of the nose print image of the target animal for identity recognition or identity entry in a video-based manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 A schematic diagram of a flow chart of a method for obtaining a nose print image provided in an embodiment of this specification;
[0018] Figure 2 A schematic diagram of a flow chart of a method for obtaining a nose print image provided in an embodiment of this specification;
[0019] Figure 3 A schematic diagram of a flow chart of a method for obtaining a nose print image provided in an embodiment of this specification;
[0020] Figure 4 An example schematic diagram of collecting facial videos is provided for the embodiment of the present application;
[0021] Figure 5 A schematic diagram of the structure of a nose print image acquisition device provided in an embodiment of this specification;
[0022] Figure 6 A schematic diagram of the structure of a video acquisition module provided in an embodiment of this specification;
[0023] Figure 7 A schematic diagram of the structure of a first mode unit provided in an embodiment of this specification;
[0024] Figure 8 A schematic diagram of the structure of a video frame determination module provided in an embodiment of this specification;
[0025] Fig. 9 A schematic diagram of the structure of a nose print image acquisition device provided in an embodiment of this specification;
[0026] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0028] In the description of this specification, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of this specification, it should be noted that, unless otherwise clearly specified and limited, "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in this specification can be understood in specific circumstances. In addition, in the description of this specification, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are an "or" relationship.
[0029] With the increase in the number of people keeping pets, various online pet management modes have been launched to help users solve problems such as pet medical care and pet loss prevention. Among the various modes, pet nose print entry and recognition are very important links. How to quickly and accurately take pictures of pet's nose prints is the key prerequisite for nose print entry and recognition.
[0030] In the prior art, when users take pictures of their pets' nose prints to register and identify the pets' identities, the pets are not easy to cooperate with, and the pictures of the pets' nose prints are often not taken in compliance with regulations, are time-consuming, and the identification of the nose prints is inaccurate.
[0031] Based on this, this specification proposes a method for obtaining a nose print image, by collecting a facial video of a target animal, determining a target video frame in the facial video, wherein the target video frame includes facial information and nose information of the target animal, the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the target video frame satisfies a third preset condition. Finally, the target video frame is used as the nose print image of the target animal, thereby realizing a method for quickly obtaining the nose print image of the target animal for identity recognition or identity entry in a video-based manner.
[0032] The following is a detailed description in conjunction with specific embodiments. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Instead, they are merely examples of devices and methods consistent with some aspects of this specification as detailed in the attached claims. The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily follow the steps shown. For example, some steps are parallel and do not have a strict logical order, so the actual execution order is variable.
[0033] See also Figure 1 , which is a flow chart of a nose print image acquisition method provided in an embodiment of this specification. In a specific embodiment, the nose print image acquisition method is applied to a nose print image acquisition device and an electronic device equipped with a nose print image acquisition device. The specific process of this embodiment will be described below using an electronic device as an example. Of course, it can be understood that the electronic device used in this embodiment can be a smart phone, a tablet computer, a desktop computer, a wearable device, etc., which is not limited here. The following will focus on Figure 1 The process shown is described in detail, and the nose print image acquisition method may specifically include the following steps:
[0034] S102, collecting a facial video of a target animal;
[0035] Specifically, when it is necessary to collect the nose print information of the target animal, the user transmits a nose print image acquisition instruction to the electronic device, and the electronic device takes a facial video of the target animal when receiving the nose print image acquisition instruction.
[0036] In one or more embodiments of the present specification, the target animal may be a cat, a canine, or other animals with unique nose patterns.
[0037] In one or more embodiments of the present specification, shooting a facial video of the target animal may be shooting a facial video of the target animal under the condition of satisfying preset shooting conditions. The preset shooting conditions may be that the face of the target animal is facing the shooting lens, the face of the target animal is completely located in the shooting viewfinder, the nose print of the target animal is clear, etc.
[0038] In one or more embodiments of the present specification, the facial video is a video containing nose prints of the target animal.
[0039] In one or more embodiments of the present specification, the facial video may be a video containing the entire frontal face of the target animal.
[0040] S104, determining a target video frame in the facial video, the target video frame including facial information and nose information of the target animal, the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the target video frame satisfies a third preset condition;
[0041] Specifically, after collecting the facial video of the target animal, the video frames in the facial video are screened to find the target video frame including the facial information of the target animal and the nose information of the target animal, the facial information meets the first preset condition, the nose information meets the second preset condition, and the blurriness of the target video frame meets the third preset condition.
[0042] It is not difficult to understand that a facial video contains multiple video frames. Since the target animal may not cooperate well during the shooting process, not all of the multiple video frames in the facial video meet the requirements of nose print recording or nose print recognition. Therefore, the target video frame is determined among the multiple video frames of the facial video according to preset conditions. The target video frame is the most suitable video frame in the facial video for nose print recognition and nose print recording.
[0043] In addition, when the target animal's nose print is recognized or recorded to register and authenticate the animal's identity, sometimes not only the target animal's nose print is used, but also some of the target animal's facial features are collected to ensure the reliability of the target animal's identity authentication. Therefore, the target video frame should contain both the target animal's facial information and nose information.
[0044] In one or more embodiments of the present specification, the facial information satisfies the first preset condition that the face of the target animal is completely located in the target video frame and the face is clear.
[0045] In one or more embodiments of the present specification, the nose information satisfies the second preset condition that the nose of the target animal is located in the target video frame and the nose print is clear.
[0046] In one or more embodiments of the present specification, the blurriness of the target video frame satisfies the third preset condition, which means that the blurriness of the target video frame satisfies a preset blurriness threshold.
[0047] Blur is a concept used to describe the clarity of an image. The lower the blur, the higher the clarity and quality of the image. The higher the blur, the lower the clarity and quality of the image. Each video frame is an image.
[0048] In one or more embodiments of the present specification, facial information may include facial size, facial direction, and the distance between the facial center and the edge of the video frame. The facial information satisfies the first preset condition may be: the facial size satisfies the first area threshold range, the facial direction satisfies the first angle threshold range, and the distance between the facial center and the edge of the video frame satisfies the first distance threshold range.
[0049] In one or more embodiments of the present specification, the nose information may include nose size, nose direction, and the distance between the center of the nose and the edge of the video frame. The nose information satisfying the second preset condition may be: the nose size satisfies the second area threshold range, the nose direction satisfies the second angle threshold range, and the distance between the center of the nose and the edge of the video frame satisfies the second distance threshold range.
[0050] S106, using the target video frame as a nose print picture of the target animal.
[0051] It can be understood that the target video frame is a video frame with comprehensive content information (i.e., both facial information and nose information) and clear image contained in the facial video of the target animal. Using this video frame as the nose print picture of the target animal to assist the target animal in nose print recording or nose print recognition can greatly ensure the probability of successful nose print recognition during the process of nose print recording or nose print recognition, thereby improving the success rate and efficiency of nose print recording or nose print recognition.
[0052] By adopting the nose print image acquisition method provided in the embodiments of this specification, by collecting the facial video of the target animal, a target video frame is determined in the facial video, the target video frame includes the facial information and nose information of the target animal, the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the target video frame satisfies a third preset condition. Finally, the target video frame is used as the nose print image of the target animal, thereby realizing that the nose print image of the target animal for identity recognition or identity entry can be quickly acquired in a video-based manner, thereby improving the success rate and efficiency of nose print entry or nose print recognition.
[0053] See also Figure 2 , is a flow chart of a method for obtaining a nose print image provided in an embodiment of this specification. Figure 2As shown, the nose print image acquisition method may include the following steps:
[0054] S202, in response to the nose print image acquisition instruction, loading a nose print image acquisition model;
[0055] Specifically, when a nose print image acquisition instruction is received, a nose print image acquisition model is loaded, and the nose print image acquisition model is used to automatically acquire the nose print image of the target animal in a video-based manner.
[0056] In one or more embodiments of the present specification, the nose print image acquisition model may be a neural network model based on deep learning.
[0057] S204, if the nose print image acquisition model fails to load, enter the second mode, and collect a facial image of the target animal based on the second mode, wherein the facial image includes facial information and nose information of the target animal;
[0058] Specifically, if the nose print image acquisition model fails to load, the second mode is entered. In the second mode, the user uses the camera shooting function of the electronic device to shoot a facial image of the target animal including the facial information and nose information of the target animal.
[0059] S206, if the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the facial image satisfies a third preset condition, then the facial image is used as a nose print image of the target animal;
[0060] S208, if the facial information does not satisfy the first preset condition and / or the nose information does not satisfy the second preset condition and / or the blurriness of the facial image does not satisfy the third preset condition, then executing the step of collecting the facial image of the target animal;
[0061] Specifically, after the user obtains a facial image of the target animal, it is determined whether the facial image of the target animal taken by the user meets preset conditions, the preset conditions including that the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the facial image satisfies a third preset condition; if the facial information of the target animal in the facial image satisfies the first preset condition, the nose information satisfies the second preset condition, and the blurriness satisfies the third preset condition, then it indicates that the facial image can be used for nose print recognition and nose print entry of the target animal, and the facial image is used as the nose print image of the target animal; if the facial information of the target animal in the facial image does not meet the first preset condition, or the nose information does not meet the second preset condition, or the blurriness does not meet the third preset condition, then it indicates that the facial image cannot be used for nose print recognition and nose print entry of the target animal, the facial image is abandoned, a facial image of the target animal is retaken, and the step of determining whether the facial image of the target animal taken by the user meets the preset conditions is executed, until a facial image meeting the preset conditions is taken.
[0062] In one or more embodiments of the present specification, facial information may include facial size, facial direction, and the distance between the facial center and the edge of the video frame. The facial information satisfies the first preset condition may be: the facial size satisfies the first area threshold range, the facial direction satisfies the first angle threshold range, and the distance between the facial center and the edge of the video frame satisfies the first distance threshold range.
[0063] In one or more embodiments of the present specification, the nose information may include nose size, nose direction, and the distance between the center of the nose and the edge of the video frame. The nose information satisfying the second preset condition may be: the nose size satisfies the second area threshold range, the nose direction satisfies the second angle threshold range, and the distance between the center of the nose and the edge of the video frame satisfies the second distance threshold range.
[0064] S210, if the nose print image acquisition model is loaded successfully, entering the first mode, and executing the acquisition of the face video of the target animal based on the first mode;
[0065] Specifically, if the nose print image acquisition model is loaded successfully, the first mode is entered. The first mode is a mode for acquiring the nose print image of the target animal based on a video. After entering the first mode, the facial video of the target animal is first collected based on the first mode.
[0066] S212, determining a target video frame in the facial video, the target video frame including facial information and nose information of the target animal, the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the target video frame satisfies a third preset condition;
[0067] Specifically, please refer to the description of step S104 for step S212, which will not be described in detail here.
[0068] S214: Use the target video frame as the nose print picture of the target animal.
[0069] Specifically, please refer to the description of step S104 for step S212, which will not be described in detail here.
[0070] By adopting the nose print image acquisition method provided in the embodiment of the present specification, when the nose print image acquisition model is loaded successfully, a facial video of the target animal is collected based on the first mode, and a target video frame is determined in the facial video, the target video frame includes facial information and nose information of the target animal, the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the target video frame satisfies a third preset condition. Finally, the target video frame is used as the nose print image of the target animal, thereby realizing that the nose print image of the target animal for identity recognition or identity entry can be quickly acquired in a video-based manner, thereby improving the success rate and efficiency of nose print entry or nose print recognition; when the nose print image acquisition model fails to be loaded, the second mode is entered, and the nose print image of the target animal is acquired by the user taking a facial image of the target animal by himself, thereby ensuring that the nose print image of the target animal can also be acquired when the nose print image acquisition model fails to be loaded, thereby ensuring the reliability of acquiring the nose print image.
[0071] In the embodiment of this specification, the face information includes the face size, face direction, and the distance between the face center and the edge of the video frame. The nose information includes the nose size, nose direction, and the distance between the nose center and the edge of the video frame. Figure 3 , is a flow chart of a method for obtaining a nose print image provided in an embodiment of this specification. Figure 3 As shown, the nose print image acquisition method may include the following steps:
[0072] S302, entering a video acquisition window, and acquiring a video frame in the video acquisition window, wherein the video frame in the video acquisition window includes facial information and nose information of the target animal;
[0073] Specifically, after obtaining the nose print image acquisition instruction, the nose print image acquisition model is loaded. After the nose print image acquisition model is successfully loaded, the first mode is entered, the video acquisition window is entered, and the real-time video frame displayed in the video acquisition window is acquired. The real-time video frame displayed in the video acquisition window should include the facial information and nose information of the target animal.
[0074] S304, determining whether the face information in the video frame in the video acquisition window satisfies a first preset condition, whether the nose information satisfies a second preset condition, and whether the blurriness of the video frame satisfies a third preset condition;
[0075] S306, if the facial information in the video frame within the video acquisition window satisfies the first preset condition, the nose information satisfies the second preset condition, and the blurriness of the video frame satisfies the third preset condition, then acquiring a facial video of the target animal for a first preset time length;
[0076] It can be understood that in order to ensure that there must be a target video frame in the collected facial video whose facial information meets the first preset condition, the nose information meets the second preset condition, and the blurriness meets the third preset condition, before collecting the facial video of the target animal, the real-time video frame displayed in the video collection window is obtained, and the real-time video frame is the video frame image of the target animal displayed in the video collection window. It is judged whether the facial information in the real-time video frame meets the first preset condition, whether the nose information meets the second preset condition, and whether the blurriness of the video frame meets the third preset condition. When the facial information meets the first preset condition, the nose information meets the second preset condition, and the blurriness of the video frame meets the third preset condition, the facial video of the target animal of the first preset duration is automatically collected.
[0077] More specifically, a real-time video frame displayed in a video acquisition window is obtained, and when facial information in the real-time video frame does not satisfy a first preset condition, or nose information does not satisfy a second preset condition, or video frame blurriness does not satisfy a third preset condition, a prompt message is displayed in the video acquisition window, and the prompt message is used to prompt the user to adjust the posture and position of the target animal so that the facial information of the video frame displayed by the imaging of the target animal in the video acquisition window satisfies the first preset condition, the nose information satisfies the second preset condition, and the video frame blurriness satisfies the third preset condition.
[0078] In one or more embodiments of the present specification, the facial information includes facial size, facial direction, and the distance between the facial center and the edge of the video frame. The facial information meets the first preset condition, including: the facial size meets the first area threshold range, the facial direction meets the first angle threshold range, and the distance between the facial center and the edge of the video frame meets the first distance threshold range. Before capturing the facial video of the target animal, when the facial information in the real-time video frame in the video capture window does not meet the first preset condition, a prompt message is automatically displayed in the video display window. For example, if the facial size in the real-time video frame in the video capture window is less than the first area threshold range, a prompt message "Please move closer to the face to shoot" is displayed in the video display window to prompt the user to move the electronic device closer to the target animal to shoot or move the target animal closer to the electronic device to shoot.
[0079] In one or more embodiments of the present specification, the nose information includes the size of the nose, the direction of the nose, and the distance between the center of the nose and the edge of the video frame. The nose information meeting the second preset condition includes: the size of the nose meets the second area threshold range, the direction of the nose meets the second angle threshold range, and the distance between the center of the nose and the edge of the video frame meets the second distance threshold range. Before capturing the facial video of the target animal, when the nose information in the real-time video frame in the video capture window does not meet the first preset condition, a prompt message is automatically displayed in the video display window. For example, if the distance between the center of the nose in the real-time video frame in the video capture window and the edge of the video frame is less than the second angle threshold range, a prompt message "Please move the nose to the center of the screen" is displayed in the video display window to prompt the user to move the electronic device close to the target animal for shooting or move the target animal close to the electronic device for shooting.
[0080] See also Figure 4 , which is a schematic diagram of an example of collecting facial videos in the embodiment of the present application. Figure 4 As shown in FIG. 1 , before collecting the face video of the target animal, at a certain moment, the image collected in the video collection window is as follows: Figure 4 As shown on the left, the face of the target animal is sideways, not facing the screen. At this time, a prompt message "Turn the face of the target animal to the screen" will appear in the video acquisition window. After seeing the prompt message, the user adjusts the shooting angle according to the prompt message, and the following is obtained in the video acquisition window. Figure 4 When the screen shown on the right appears, it will automatically start recording the face of the target animal.
[0081] S308, identifying each video frame in the face video in turn according to a preset recognition rule, and determining whether there is a video frame that satisfies the preset recognition rule in each video frame, wherein the preset recognition rule is that the face size satisfies a first area threshold range, the face direction satisfies a first angle threshold range, the distance between the face center and the edge of the video frame satisfies a first distance threshold range, the nose size satisfies a second area threshold range, the nose direction satisfies a second angle threshold range, the distance between the nose center and the edge of the video frame satisfies a second distance threshold range, and the blurriness of the video frame is less than a preset blurriness threshold;
[0082] S310, if there is a video frame satisfying the preset recognition rule in each of the video frames, taking the video frame satisfying the preset recognition rule in the face video as the target video frame;
[0083] Specifically, after the facial video of the target animal is collected, each video frame in the facial video is identified in turn to determine whether there is a target video frame that meets the preset rules in each video frame in the collected facial video. The target video frame that meets the preset identification rules meets the requirements of nose print recording and nose print recognition and can be used for nose print recording and nose print recognition. The preset identification rules are that the face size meets the first area threshold range, the face direction meets the first angle threshold range, the distance between the face center and the edge of the video frame meets the first distance threshold range, the nose size meets the second area threshold range, the nose direction meets the second angle threshold range, the distance between the nose center and the edge of the video frame meets the second distance threshold range, and the blurriness of the video frame is less than the preset blurriness threshold.
[0084] Among them, face size refers to the face area value of the target animal in the target video frame. When the face size meets the preset first area threshold range, the target video frame is most suitable for nose print recording and recognition; face direction refers to the direction angle of the target animal's face in the target video frame. When the face of the target animal is facing the screen and the face of the target animal in the target video frame is basically symmetrical on the left and right, the target video frame is most suitable for nose print recording and recognition; face center refers to the geometric center of the face of the target animal in the target video frame. When the face center is located in a specified area in the target video frame, that is, when the distance between the face center and the edge of the video frame meets the first distance threshold range, the target video frame is most suitable for nose print recording and recognition; nose size refers to the face angle of the target animal in the target video frame. The nose area value of the target animal, when the nose size meets the preset second area threshold range, the target video frame is most suitable for nose print recording and nose print recognition; the nose direction refers to the direction angle of the target animal's nose in the target video frame, when the target animal's nose is facing the screen and the target animal's nose is basically symmetrical in the target video frame, the target video frame is most suitable for nose print recording and nose print recognition; the nose center refers to the geometric center of the target animal's nose in the target video frame, when the nose center is located in a specified area in the target video frame, that is, when the distance between the nose center and the edge of the video frame meets the second distance threshold range, the target video frame is most suitable for nose print recording and nose print recognition; the blurriness of the video frame being less than the preset blurriness threshold means that the target video frame is clear enough.
[0085] Optionally, if there is no target video frame that meets the preset recognition rules in the collected facial video, it is determined whether the recognition time of each video frame in the facial video exceeds a second preset time; if the recognition time does not exceed the second preset time, each video frame in the facial video continues to be recognized in turn to determine whether there is a target video frame that meets the preset recognition rules; if the recognition time exceeds the second preset time, the second mode is entered, and a facial picture of the target animal is collected based on the second mode, the facial picture including facial information and nose information of the target animal, if the facial information meets the first preset condition, the nose information meets the second preset condition and the blurriness of the facial picture meets the third preset condition, the facial picture is used as the nose print picture of the target animal.
[0086] S312, using the target video frame as a nose print picture of the target animal;
[0087] S314, uploading the nose print image to a server, so that the server can identify the identity of the target animal based on the nose print image.
[0088] By using the nose print image acquisition method provided in the embodiment of the present specification, before facial video acquisition, it is first determined whether the facial information of the target animal in the video frame displayed in the video acquisition window meets the first preset condition, whether the nose information meets the second preset condition, and whether the blur of the video frame meets the third preset condition. When the facial information in the video frame does not meet the first preset condition, the nose information does not meet the second preset condition, or the blur of the video frame does not meet the third preset condition, a prompt message is displayed in the video acquisition window to prompt the user to adjust the position and posture of the target animal in the video acquisition window. Only when the facial information of the target animal in the video frame displayed in the video acquisition window meets the first preset condition, the nose information meets the second preset condition, or the blur of the video frame meets the third preset condition, the prompt message is displayed in the video acquisition window to prompt the user to adjust the position and posture of the target animal in the video acquisition window. When the first preset condition is met, the nose information meets the second preset condition, and the video frame blur meets the third preset condition, the facial video of the target animal is collected to ensure that the target video frame that meets the preset recognition rule exists in the collected facial video; then the target video frame that meets the preset recognition rule is determined in the collected facial video, and the target video frame is used as the nose print picture of the target animal. Finally, the nose print picture is uploaded to the server, so that the server recognizes the identity of the target animal based on the nose print picture, thereby realizing the rapid acquisition of the nose print picture of the target animal for identity recognition or identity entry in a video-based manner, thereby improving the success rate and efficiency of nose print entry or nose print recognition.
[0089] See also Figure 5 , is a schematic diagram of the structure of a nose print image acquisition device provided in an embodiment of this specification. Figure 5As shown, the nose print image acquisition device 1 can be implemented as all or part of an electronic device through software, hardware or a combination of both. According to some embodiments, the nose print image acquisition device 1 includes a video acquisition module 11, a video frame determination module 12 and a nose print image determination module 13, specifically including:
[0090] A video acquisition module 11 is used to collect facial videos of target animals;
[0091] A video frame determination module 12 is used to determine a target video frame in the face video, wherein the target video frame includes face information and nose information of the target animal, the face information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the target video frame satisfies a third preset condition;
[0092] The nose print picture determination module 13 is used to use the target video frame as the nose print picture of the target animal.
[0093] Optional, see Figure 6 , is a schematic diagram of the structure of a video acquisition module provided in an embodiment of this specification. Figure 6 As shown, the video acquisition module 11 includes:
[0094] A nose print model loading unit 111 is used to load a nose print image acquisition model in response to a nose print image acquisition instruction;
[0095] The first mode unit 112 is configured to enter the first mode if the nose print image acquisition model is loaded successfully, and execute the step of collecting the facial video of the target animal based on the first mode.
[0096] Optional, see Figure 6 The video acquisition module 11 further includes a second mode unit, wherein the second mode unit 113 is specifically configured to:
[0097] If the nose print image acquisition model fails to load, the second mode is entered, and a facial image of the target animal is collected based on the second mode, where the facial image includes facial information and nose information of the target animal;
[0098] If the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the facial image satisfies a third preset condition, the facial image is used as a nose print image of the target animal;
[0099] If the facial information does not satisfy the first preset condition and / or the nose information does not satisfy the second preset condition and / or the blurriness of the facial image does not satisfy the third preset condition, the step of collecting the facial image of the target animal is performed.
[0100] Optional, see Figure 7 , is a schematic diagram of the structure of a first mode unit provided in an embodiment of this specification. Figure 7 As shown, the first mode unit 112 includes:
[0101] The video frame acquisition subunit 1121 is used to enter the video acquisition window and acquire the video frame in the video acquisition window, wherein the video frame in the video acquisition window includes the face information and nose information of the target animal;
[0102] The video frame determination subunit 1122 is used to determine whether the face information in the video frame in the video acquisition window meets the first preset condition, whether the nose information meets the second preset condition, and whether the blurriness of the video frame meets the third preset condition;
[0103] The video acquisition subunit 1123 is used to acquire the facial video of the target animal of a first preset duration if the facial information in the video frame within the video acquisition window meets the first preset condition, the nose information meets the second preset condition, and the blurriness of the video frame meets the third preset condition.
[0104] Optionally, the video acquisition subunit 1123 is specifically used for:
[0105] If the face size satisfies a first area threshold range, the face direction satisfies a first angle threshold range, the distance between the face center and the edge of the video frame satisfies a first distance threshold range, the nose size satisfies a second area threshold range, the nose direction satisfies a second angle threshold range, the distance between the nose center and the edge of the video frame satisfies a second distance threshold range, and the blurriness of the video frame is less than a preset blurriness threshold, then a facial video of the target animal of a first preset duration is captured.
[0106] Optional, see Figure 8 , is a schematic diagram of the structure of a video frame determination module provided in an embodiment of this specification. Figure 8 As shown, the video frame determination module 12 includes:
[0107] The video frame recognition unit 121 is used to sequentially recognize each video frame in the face video according to a preset recognition rule, and determine whether there is a video frame that meets the preset recognition rule in each video frame, wherein the preset recognition rule is that the face size meets a first area threshold range, the face direction meets a first angle threshold range, the distance between the face center and the edge of the video frame meets a first distance threshold range, the nose size meets a second area threshold range, the nose direction meets a second angle threshold range, the distance between the nose center and the edge of the video frame meets a second distance threshold range, and the blurriness of the video frame is less than a preset blurriness threshold;
[0108] The target video frame determining unit 122 uses the video frame in the face video that meets the preset recognition rule as the target video frame if there is a video frame that meets the preset recognition rule in each of the video frames.
[0109] Optional, see Figure 8 The video frame determination module 12 further includes a recognition timeout unit 123, wherein the recognition timeout unit 123 is specifically configured to:
[0110] If there is no video frame satisfying the preset recognition rule among the video frames, determining whether the recognition time exceeds a second preset time;
[0111] If the recognition time does not exceed the second preset time, performing the step of sequentially recognizing each video frame in the face video according to the preset recognition rule, and determining whether there is a video frame in each video frame that meets the preset recognition rule;
[0112] If the recognition time exceeds the second preset time, the second mode is entered, and a facial image of the target animal is collected based on the second mode, where the facial image includes facial information and nose information of the target animal;
[0113] If the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the facial image satisfies a third preset condition, the facial image is used as a nose print image of the target animal;
[0114] If the facial information does not satisfy the first preset condition and / or the nose information does not satisfy the second preset condition and / or the blurriness of the facial image does not satisfy the third preset condition, the step of collecting the facial image of the target animal is performed.
[0115] Optional, see Fig. 9 , is a schematic diagram of the structure of a nose print image acquisition device provided in an embodiment of this specification. Fig. 9 As shown, the nose print image acquisition device further includes:
[0116] The nose print recognition module 14 is used to upload the nose print image to the server so that the server can recognize the identity of the target animal based on the nose print image.
[0117] By adopting the nose print image acquisition method provided in the embodiment of the present specification, when the nose print image acquisition model is loaded successfully, a facial video of the target animal is collected based on the first mode, and a target video frame is determined in the facial video, the target video frame includes facial information and nose information of the target animal, the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the target video frame satisfies a third preset condition. Finally, the target video frame is used as the nose print image of the target animal, thereby realizing that the nose print image of the target animal for identity recognition or identity entry can be quickly acquired in a video-based manner, thereby improving the success rate and efficiency of nose print entry or nose print recognition; when the nose print image acquisition model fails to be loaded, the second mode is entered, and the nose print image of the target animal is acquired by the user taking a facial image of the target animal by himself, thereby ensuring that the nose print image of the target animal can also be acquired when the nose print image acquisition model fails to be loaded, thereby ensuring the reliability of acquiring the nose print image.
[0118] The present specification also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 1 to Figure 4 The nose print image acquisition method of the embodiment shown in the figure can be found in the specific execution process. Figure 1 to Figure 4 The specific description of the illustrated embodiment will not be repeated here.
[0119] The present specification also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor as described above. Figure 1 to Figure 4 The nose print image acquisition method of the embodiment is shown in FIG. Figure 1 to Figure 4 The specific description of the embodiment is shown in detail and will not be repeated here.
[0120] Please refer to Fig.10 1 shows a block diagram of an electronic device provided by an exemplary embodiment of the present specification. The electronic device in the present specification may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected via the bus 150.
[0121] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.
[0122] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets.
[0123] The input device 130 is used to receive input instructions or data, and the input device 130 includes but is not limited to a keyboard, a mouse, a camera, a microphone or a touch device. The output device 140 is used to output instructions or data, and the output device 140 includes but is not limited to a display device and a speaker. In the embodiment of this specification, the input device 130 can be a temperature sensor for obtaining the operating temperature of the electronic device. The output device 140 can be a speaker for outputting audio signals.
[0124] In addition, those skilled in the art will appreciate that the structure of the electronic device shown in the above drawings does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown, or combine certain components, or arrange the components differently. For example, the electronic device also includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a Bluetooth module and other components, which will not be described in detail here.
[0125] In the embodiments of this specification, the execution subject of each step may be the electronic device described above. Optionally, the execution subject of each step is the operating system of the electronic device. The operating system may be an Android system, an IOS system, or other operating systems, which is not limited in the embodiments of this specification.
[0126] exist Fig.10 In the electronic device, the processor 110 can be used to call the nose print image acquisition program stored in the memory 120 and execute it to implement the nose print image acquisition method as described in the various method embodiments of this specification.
[0127] By adopting the nose print image acquisition method provided in the embodiment of the present specification, when the nose print image acquisition model is loaded successfully, a facial video of the target animal is collected based on the first mode, and a target video frame is determined in the facial video, the target video frame includes facial information and nose information of the target animal, the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the target video frame satisfies a third preset condition. Finally, the target video frame is used as the nose print image of the target animal, thereby realizing that the nose print image of the target animal for identity recognition or identity entry can be quickly acquired in a video-based manner, thereby improving the success rate and efficiency of nose print entry or nose print recognition; when the nose print image acquisition model fails to be loaded, the second mode is entered, and the nose print image of the target animal is acquired by the user taking a facial image of the target animal by himself, thereby ensuring that the nose print image of the target animal can also be acquired when the nose print image acquisition model fails to be loaded, thereby ensuring the reliability of acquiring the nose print image.
[0128] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0129] The above disclosure is only the preferred embodiment of this specification, which certainly cannot be used to limit the scope of rights of this specification. Therefore, equivalent changes made according to the claims of this specification are still within the scope covered by this specification.
[0130] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Claims
1. A method for obtaining a nose print image, the method include: Collect a video of the target animal’s face; Determine a target video frame in the facial video, the target video frame including facial information and nose information of the target animal, the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the target video frame satisfies a third preset condition; Using the target video frame as the nose print picture of the target animal; The collecting of the face video of the target animal includes: responding to a nose print image acquisition instruction, loading a nose print image acquisition model; If the nose print image acquisition model is loaded successfully, the first mode is entered, and the step of collecting the facial video of the target animal is performed based on the first mode.
2. The method according to claim 1, further comprising: include: If the nose print image acquisition model fails to load, the second mode is entered, and a facial image of the target animal is collected based on the second mode, where the facial image includes facial information and nose information of the target animal; If the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the facial image satisfies a third preset condition, the facial image is used as a nose print image of the target animal; If the facial information does not satisfy the first preset condition and / or the nose information does not satisfy the second preset condition and / or the blurriness of the facial image does not satisfy the third preset condition, the step of collecting the facial image of the target animal is performed.
3. The method according to claim 1, wherein the facial video of the target animal is collected. include: Entering a video acquisition window, acquiring a video frame in the video acquisition window, wherein the video frame in the video acquisition window includes facial information and nose information of the target animal; Determining whether the face information in the video frame in the video acquisition window satisfies a first preset condition, whether the nose information satisfies a second preset condition, and whether the blurriness of the video frame satisfies a third preset condition; If the facial information in the video frame within the video acquisition window meets the first preset condition, the nose information meets the second preset condition, and the blurriness of the video frame meets the third preset condition, then the facial video of the target animal of the first preset duration is acquired.
4. The method according to claim 3, wherein the facial information includes facial size, facial direction, and the distance between the facial center and the edge of the video frame, and the nose information includes nose size, nose direction, and the distance between the nose center and the edge of the video frame, and if the facial information in the video frame within the video acquisition window satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the video frame satisfies a third preset condition, then a facial video of the target animal of a first preset duration is acquired, include: If the face size satisfies a first area threshold range, the face direction satisfies a first angle threshold range, the distance between the face center and the edge of the video frame satisfies a first distance threshold range, the nose size satisfies a second area threshold range, the nose direction satisfies a second angle threshold range, the distance between the nose center and the edge of the video frame satisfies a second distance threshold range, and the blurriness of the video frame is less than a preset blurriness threshold, then a facial video of the target animal of a first preset duration is captured.
5. The method according to claim 1, wherein the facial information includes facial size, facial direction, and the distance between the facial center and the edge of the video frame, and the nose information includes nose size, nose direction, and the distance between the nose center and the edge of the video frame. The target video frame is determined in the facial video, and the target video frame includes the facial information and nose information of the target animal. The facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the target video frame satisfies a third preset condition. include: Identify each video frame in the face video in turn according to a preset identification rule, and determine whether there is a video frame that satisfies the preset identification rule in each video frame, wherein the preset identification rule is that the face size satisfies a first area threshold range, the face direction satisfies a first angle threshold range, the distance between the face center and the edge of the video frame satisfies a first distance threshold range, the nose size satisfies a second area threshold range, the nose direction satisfies a second angle threshold range, the distance between the nose center and the edge of the video frame satisfies a second distance threshold range, and the blurriness of the video frame is less than a preset blurriness threshold; If there is a video frame satisfying the preset recognition rule in each of the video frames, the video frame satisfying the preset recognition rule in the face video is used as the target video frame.
6. The method according to claim 5, further comprising: include: If there is no video frame satisfying the preset recognition rule among the video frames, determining whether the recognition time exceeds a second preset time; If the recognition time does not exceed the second preset time, performing the step of sequentially recognizing each video frame in the face video according to the preset recognition rule, and determining whether there is a video frame in each video frame that meets the preset recognition rule; If the recognition time exceeds the second preset time, the second mode is entered, and a facial image of the target animal is collected based on the second mode, where the facial image includes facial information and nose information of the target animal; If the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the facial image satisfies a third preset condition, the facial image is used as a nose print image of the target animal; If the facial information does not satisfy the first preset condition and / or the nose information does not satisfy the second preset condition and / or the blurriness of the facial image does not satisfy the third preset condition, the step of collecting the facial image of the target animal is performed.
7. The method according to claim 1, after using the target video frame as the nose print picture of the target animal, further comprising: include: The nose print image is uploaded to a server so that the server can identify the identity of the target animal based on the nose print image.
8. A device for obtaining a nose print image, the device include: A video acquisition module is used to collect facial videos of target animals; A video frame determination module, used to determine a target video frame in the facial video, wherein the target video frame includes facial information and nose information of the target animal, the facial information satisfies a first preset condition, the nose information satisfies a second preset condition, and the blurriness of the target video frame satisfies a third preset condition; A nose print picture determination module, used for taking the target video frame as the nose print picture of the target animal; The video acquisition module is also used to load a nose print image acquisition model in response to a nose print image acquisition instruction; if the nose print image acquisition model is loaded successfully, enter the first mode and execute the step of collecting the facial video of the target animal based on the first mode.
9. A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.
10. An electronic device, include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the method as claimed in any one of claims 1 to 7.
11. A computer program product having stored thereon at least one instruction, It is characterized in that When the at least one instruction is executed by the processor, the steps of the method described in any one of claims 1 to 7 are implemented.
