Pet identity identification method and device, electronic equipment and storage medium
By optimizing pet nose print images and matching recognition accuracy, the problem of low accuracy in pet identification has been solved, achieving high-precision and high-accuracy pet identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NEW RUIPENG PET HEALTHCARE GRP CO LTD
- Filing Date
- 2022-07-15
- Publication Date
- 2026-04-10
AI Technical Summary
Existing methods for pet identification based on nose prints suffer from low image precision, resulting in low identification accuracy.
By acquiring pet nose print images and optimizing them using appropriate modes, and combining this with the recognition accuracy required for current identity verification, we can improve image precision and recognition accuracy.
It improves the accuracy and precision of pet identification, making it suitable for scenarios such as community management and amusement park management.
Smart Images

Figure CN115376160B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image recognition, in particular to a pet identity recognition method and device, electronic equipment and a storage medium. BACKGROUND
[0002] In recent years, more and more people choose to keep pets. According to the White Paper on the Pet Industry, the number of pet dogs and cats in China reached 99.15 million in 2019, an increase of 7.66 million over 2018. Among them, the number of pet dogs was 55.03 million, an increase of 8.2% over 2018; the number of pet cats was 44.12 million, an increase of 8.6% over 2018, and the growth rate of pet cats was higher than that of pet dogs. In 2022, the number of pet dogs and cats in China will have a greater breakthrough.
[0003] With the increasing number of pets, the management of pets is becoming more and more difficult, especially the identity management of pets. In order to facilitate the management of pet identity, pet chips have emerged in foreign countries and even in China, that is, the identity information of the pet is stored in the pet chip, and the pet chip is implanted into the body of the pet. In this way, the identity of the pet can be identified by reading the information in the chip. This implantation method is relatively harmful to the pet's body, and the chip is expensive. Moreover, illegal individuals can take the chip out of the body, and still cannot obtain the identity of the pet. Based on this, a pet identity recognition method based on pet noseprint is developed. That is, the identity of the pet is recognized based on the pet's noseprint, without any operation on the pet, with relatively low cost, and no harm to the pet. The pet identity recognition method based on pet noseprint is gradually popular and hot.
[0004] However, when the pet is identified based on the pet noseprint at present, the accuracy of the pet noseprint image obtained is relatively low, resulting in low accuracy of the identity recognition of the pet. SUMMARY
[0005] The pet identity recognition method, device, electronic equipment and storage medium provided by the embodiments of the present application optimize the pet noseprint image through an optimization mode adapted to the pet noseprint image, obtain a high-precision to-be-recognized image, and identify the identity according to the recognition accuracy of the user equipment, thereby improving the accuracy of the pet identity recognition.
[0006] In a first aspect, the embodiments of the present application provide a pet identity recognition method, comprising:
[0007] obtaining a pet noseprint image and a recognition accuracy corresponding to a current identity recognition requirement;
[0008] determining at least one optimization mode corresponding to the pet noseprint image according to the shooting information of the pet noseprint image and the pet noseprint image;
[0009] optimize the pet noseprint image using the at least one optimization mode to obtain a to-be-identified image;
[0010] perform target detection on the to-be-identified image to obtain a target image;
[0011] perform identity recognition on the target image according to the recognition accuracy to obtain identity information of the pet
[0012] In a second aspect, an embodiment of the present application provides a pet identity recognition device, comprising: an acquisition unit and a processing unit.
[0013] The acquisition unit is configured to acquire a pet noseprint image and an identification accuracy corresponding to a current identity recognition requirement.
[0014] The processing unit is configured to determine at least one optimization mode corresponding to the pet noseprint image according to shooting information of the pet noseprint image and the pet noseprint image; optimize the pet noseprint image using the at least one optimization mode to obtain a to-be-identified image; perform target detection on the to-be-identified image to obtain a target image; and perform identity recognition on the target image according to the identification accuracy to obtain identity information of the pet.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, wherein the processor is connected with a memory, the memory is configured to store a computer program, and the processor is configured to execute the computer program stored in the memory, so that the electronic device performs the method according to the first aspect.
[0016] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program causes a computer to perform the method according to the first aspect.
[0017] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a non-transitory computer readable storage medium storing a computer program, and the computer is operable to cause a computer to perform the method according to the first aspect.
[0018] The embodiment of the present application has the following beneficial effects:
[0019] It can be seen that in the embodiments of the present application, after the pet noseprint image is obtained, the pet noseprint image is not directly used for pet identity recognition, but at least one optimized mode suitable for the pet noseprint image is obtained first, and the pet noseprint image is optimized to obtain a high-precision to-be-recognized image, thereby improving the accuracy of subsequent pet identity recognition. In addition, after obtaining the to-be-recognized image, the to-be-recognized image is not directly used for identity verification, but the recognition accuracy corresponding to the current identity recognition requirement is combined with the to-be-recognized image to identify the identity of the pet, that is, the identity of the pet is identified in combination with the current recognition requirement, to further improve the accuracy of pet identity recognition. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0021] Figure 1 A schematic diagram of a pet identity recognition system provided by an embodiment of the present application;
[0022] Figure 2a An application scenario of cell management based on pet identity recognition provided by an embodiment of the present application;
[0023] Figure 2b An application scenario of amusement park management based on pet identity recognition provided by an embodiment of the present application;
[0024] Figure 3 A flowchart of a pet identity recognition method provided by an embodiment of the present application;
[0025] Figure 4 A schematic diagram of intercepting a plurality of sub-images provided by an embodiment of the present application;
[0026] Figure 5 Another schematic diagram of intercepting a plurality of sub-images provided by an embodiment of the present application;
[0027] Figure 6 A flowchart of a target detection method provided by an embodiment of the present application;
[0028] Figure 7 A schematic diagram of a first target detection model provided by an embodiment of the present application;
[0029] Figure 8 A schematic diagram of a second target detection model provided by an embodiment of the present application;
[0030] Figure 9 A functional unit composition block diagram of a pet identity recognition device is provided for an embodiment of the present application.
[0031] Figure 10 A structural schematic diagram of an electronic device is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0032] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0033] The terms “first”, “second”, “third”, and “fourth” and the like in the specification of the present application and claims and the drawings are used to distinguish different objects, rather than to describe a particular order. In addition, the terms “include” and “have” and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed or can optionally include other steps or units inherent to the process, method, product or device.
[0034] In this document, the term “embodiment” means that a particular feature, result or characteristic described in connection with an embodiment can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment is referred to, nor does it mean that independent or alternative embodiments are mutually exclusive or alternative to other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0035] Reference Figure 1 , Figure 1 A pet identity recognition system is provided for an embodiment of the present application. The pet identity recognition system includes an image acquisition device 10, a pet identity recognition device 20 and a cloud server 30. Among them, the image acquisition device 10, the pet identity recognition device 20 and the cloud server 30 keep communication connection, and the image acquisition device 10 can be integrated on the pet identity recognition device 20, and the server 30 is an optional device.
[0036] For example, the pet noseprint image is obtained by capturing the nose of the pet by the image acquisition device 10. Correspondingly, the pet identity recognition device 20 can obtain the pet noseprint image by the image acquisition device 10; then, an identification accuracy corresponding to the current identity recognition requirement is obtained, which is pre-configured to the pet identity recognition device 20. Further, the pet identity recognition device 20 determines at least one optimization mode corresponding to the pet noseprint image according to the capturing information of the pet noseprint image and the pet noseprint image; optimizes the pet noseprint image by using the at least one optimization mode to obtain a to-be-recognized image; performs target detection on the to-be-recognized image to obtain a target image; and performs identity recognition on the target image according to the identification accuracy to obtain the identity information of the pet.
[0037] Alternatively, the above process of performing identity recognition on the pet noseprint image can also be implemented by the cloud server 30. For example, the pet identity recognition device 20 obtains the pet noseprint image, sends the identification accuracy and the pet noseprint image to the cloud server 30, and instructs the cloud server 30 to perform identity recognition.
[0038] As can be seen, in the embodiments of the present application, after obtaining the pet noseprint image, the pet noseprint image is not directly used for pet identity recognition, but at least one optimization mode suitable for the pet noseprint image is obtained first, and the pet noseprint image is optimized to obtain a high-precision to-be-recognized image, thereby improving the accuracy of subsequent pet identity recognition. In addition, after obtaining the to-be-recognized image, the to-be-recognized image is not directly used for identity verification, but the identity of the pet is recognized in combination with the identification accuracy corresponding to the current identity recognition requirement and the to-be-recognized image, that is, the identity of the pet is recognized in combination with the current recognition requirement, thereby further improving the accuracy of pet identity recognition.
[0039] Firstly, it is explained that the pet identity recognition method of the present application can be applied to various pet identity recognition scenes. The application scenarios of the present application are described below with several actual scenes.
[0040] Figure 2a An application scenario of community management based on pet identity recognition is shown. As shown in Figure 2a When the pet enters the community, the access control terminal of the community can verify whether the pet is a pet of the community by executing the pet identity recognition method of the present application; if the pet is verified to be a pet of the community, the pet is released and allowed to enter the community. When the pet leaves the community, the access control terminal can identify the identity of the pet by executing the pet identity recognition method of the present application, obtain the contact information of the owner of the pet based on the identity, and send a prompt information to the owner of the pet through the contact information, the prompt information being used to prompt the owner of the pet that the pet is about to leave the community, and the owner should pay attention to the behavior of the pet in time.
[0041] Figure 2b An application scenario of amusement park management based on pet identity recognition is shown. As shown in Figure 2b When the pet enters the amusement park, the gate terminal of the amusement park can verify whether the pet has a reservation by performing the pet identity recognition method of the present application; if there is a reservation, the pet is released and allowed to enter the amusement park. When the pet leaves the amusement park, the gate terminal can identify the identity of the pet by performing the pet identity recognition method of the present application, obtain the contact information of the owner of the pet based on the identity, and send a prompt message to the owner of the pet through the contact information, which is used to prompt the owner of the pet that the pet is about to leave the amusement park, and please pay attention to the behavior of the pet in time.
[0042] Referring to Figure 3 , Figure 3 A flowchart of a pet identity recognition method provided by an embodiment of the present application. The method is applied to the pet identity recognition device described above. The method includes but is not limited to the following steps:
[0043] 301: Obtain a pet noseprint image and an identification accuracy corresponding to a current identity recognition requirement.
[0044] Illustratively, the pet can be photographed by the image acquisition device 10 described above, and then the pet noseprint image photographed by the image acquisition device 10 is sent to the pet identity recognition device; or the user terminal sends a pet noseprint image pre-stored or photographed to the pet identity recognition device.
[0045] Illustratively, the user can send the identification accuracy corresponding to the current identity recognition requirement to the pet identity recognition device through the user terminal; or the pet identity recognition device is provided with an input-output device (for example, a keyboard or a display screen), and the user can input the identification accuracy through the input-output device; or a pre-set identification accuracy is set for each identity recognition requirement, the current identity recognition requirement is detected, and then the identification accuracy corresponding to the current identity recognition requirement is obtained.
[0046] The identity recognition requirement includes but is not limited to: reservation authentication (for example, identity verification after a beauty reservation), park entry identity management (for example, identity verification for entering an amusement park), public place identity registration (for example, identity registration for entering a concert or a park), etc.
[0047] 302: Determine at least one optimization mode corresponding to the pet noseprint image according to the shooting information of the pet noseprint image and the pet noseprint image.
[0048] Exemplarily, when the pet noseprint image is obtained by photographing the pet, the photographing information at that time can be stored into the pet noseprint image. For example, the format of the pet noseprint image is set as JPEG File Interchange Format (JFIF), and the photographing information is stored into the pet noseprint image. Correspondingly, after the pet noseprint image is obtained by the pet identity recognition device, the photographing information of the pet noseprint image in JFIF is parsed.
[0049] Exemplarily, the photographing information includes environmental information, i.e. the environmental information when the pet is photographed.
[0050] Further, at least one optimization mode corresponding to the pet noseprint image is determined according to the pet noseprint image and the environmental information. The optimization mode includes one or more of denoising processing, enhancement processing, correction processing and completion processing. The denoising processing is to remove noise in the image; the enhancement processing is to enhance the brightness of the image; the correction processing is to correct the image; and the completion processing is to complete the features of the image, which in this application mainly refers to completing the noseprint features of the pet in the image.
[0051] Further, the content of environmental noise of the pet noseprint image is determined according to the environmental information. Specifically, the block strategy of the pet noseprint image is determined according to the above-mentioned environmental information. For example, the above-mentioned environmental information includes the content of PM2.5, and the block strategy is determined based on the content of PM2.5 and a preset corresponding relationship. The pet noseprint image is blocked based on the block strategy to obtain a plurality of image blocks. The noise content of each image block is calculated, and the total noise content of the plurality of image blocks is taken as the content of environmental noise of the pet noseprint image. If the content is greater than a first threshold, it is determined that the at least one optimization mode includes denoising processing, i.e. the pet noseprint image needs to be denoised. The environmental brightness when the pet noseprint image is photographed is determined according to the environmental information. Specifically, the environmental brightness when the pet noseprint image is photographed is recorded in the environmental information. If the environmental brightness is less than a second threshold, it is determined that the at least one optimization mode includes enhancement processing, i.e. it is determined that the pet noseprint image needs to be enhanced. If the pet noseprint image is tilted, it is determined that the at least one optimization mode includes correction processing. If the noseprint of the pet noseprint image is missing, it is determined that the at least one optimization mode includes completion processing. Exemplarily, edge detection can be performed on the pet noseprint image, and then the detected edges are drawn. If the drawn connected region does not conform to the shape of the noseprint, it is determined that the noseprint in the pet noseprint image is missing and needs to be completed.
[0052] It should be noted that the correction processing, the denoising processing, the enhancement processing and the completion processing are taken as examples in the at least one optimization mode.
[0053] 303: optimizing the pet noseprint image using the at least one optimization mode to obtain a to-be-identified image.
[0054] For example, an optimization sequence of the at least one optimization mode is obtained, and the pet noseprint image is optimized using the at least one optimization mode in the optimization sequence to obtain the to-be-identified image. The optimization sequence is pre-set. Generally, the optimization sequence can be correction processing, denoising processing, enhancement processing, and completion processing. That is, the pet noseprint image is first corrected using the correction processing, then the pet noseprint image after the correction processing is denoised using the denoising processing, and then the pet noseprint image after the denoising is enhanced using the enhancement processing. Finally, the pet noseprint image after the enhancement is completed using the completion processing.
[0055] 304: target detection is performed on the to-be-identified image to obtain a target image.
[0056] For example, a target detection model corresponding to the to-be-identified image is called to perform target detection on the to-be-identified image to obtain a target region where the noseprint is located in the pet noseprint image. An image of the target region is intercepted to obtain the target image. The process of target detection on the to-be-identified image is described in detail later, and will not be described in detail here.
[0057] 305: identity recognition is performed on the target image according to the recognition accuracy to obtain identity information of the pet.
[0058] Optionally, if the recognition accuracy is greater than a third threshold, the target image is scaled to a preset size to obtain a candidate image. It should be understood that if the size of the target image is greater than the preset size, the target image is scaled down to the preset size to obtain the candidate image; if the size of the target image is less than the preset size, the target image is scaled up to the preset size to obtain the candidate image. The preset size is the size of a template noseprint image, and the template noseprint image is a pet noseprint image of each pet recorded. When recording the pet noseprint image of each pet, the size of each pet noseprint image obtained is converted to the preset size before being saved. Further, a preset radius and a preset offset value corresponding to the recognition accuracy are obtained. For example, a correspondence relationship among the recognition accuracy, the preset radius and the preset offset value is set in advance. Based on the correspondence relationship and the recognition accuracy corresponding to the current identity recognition requirement, the preset radius and the preset offset value are obtained. Further, the candidate image is intercepted multiple times according to the preset radius and the preset offset value to obtain multiple sub-images. Specifically, the preset radius is offset according to the preset offset value to obtain multiple interception radii, wherein the multiple interception radii include the preset radius, that is, the preset radius is taken as a basic radius, and then the preset radius is offset multiple times based on the preset offset value to obtain the multiple interception radii.
[0059] For example, the i-th interception radius in the multiple interception radii satisfies the following formula:
[0060] r i = r0 + (i-1) * offset;
[0061] wherein r i is the i-th interception radius, r0 is the preset radius, offset is the preset offset value, i is an integer from 1 to N, and N is the number of the multiple interception radii.
[0062] Optionally, as shown in FIG. 8, a center pixel point of the candidate image is obtained, and the candidate image is intercepted with each interception radius to obtain multiple circular images; then, each circular image is taken as a sub-image to obtain multiple sub-images. Figure 4 Optionally, as shown in FIG. 8, a center pixel point of the candidate image is obtained, and the candidate image is intercepted with each interception radius to obtain multiple circular images; then, each circular image is taken as a sub-image to obtain multiple sub-images.
[0063] Figure 5 Optionally, as shown in FIG. 8, a center pixel point of the candidate image is obtained, and the candidate image is intercepted with each interception radius to obtain multiple circular images; then, each circular image is taken as a sub-image to obtain multiple sub-images.
[0064] Further, identity recognition is performed according to the plurality of sub-images, and identity information of the pet is obtained.
[0065] Specifically, based on the manner of obtaining the plurality of sub-images, the plurality of sub-noseprint image templates corresponding to each noseprint image template are obtained by using a plurality of intercept radii to intercept each noseprint image template. Then, for each intercept radius, the sub-image obtained by intercepting the pet noseprint image using the intercept radius is matched with the sub-template noseprint image obtained by intercepting each noseprint image template using the intercept radius, and the similarity between the sub-image and the sub-template noseprint image is obtained. For example, feature extraction is performed on the sub-image to obtain a feature vector corresponding to the sub-image, and feature extraction is performed on the sub-template image to obtain a feature vector corresponding to the sub-template image. Based on the feature vector corresponding to the sub-image and the feature vector corresponding to the sub-template image, the similarity between the sub-image and the sub-template noseprint image is determined. Then, the similarity is taken as the similarity between the pet noseprint image and each noseprint image template under each intercept radius, and further, a plurality of similarities between the pet noseprint image and each noseprint image template under a plurality of intercept radii are obtained. Finally, based on the weight corresponding to each intercept radius, the plurality of similarities between the pet noseprint image and each noseprint image template under a plurality of intercept radii are weighted, and the target similarity between the pet noseprint image and each noseprint image template is obtained.
[0066] For example, according to each intercept radius, the weight corresponding to each intercept radius is determined. Alternatively, the plurality of intercept radii are normalized to obtain the weight corresponding to each intercept radius. It should be noted that when the plurality of intercept radii are normalized, the larger the intercept radius, the greater the corresponding weight. This is because the larger the intercept radius, the more noseprint features are extracted from the pet noseprint image, and these noseprint features are more convincing in matching. Therefore, through normalization, the accurate weight corresponding to each intercept radius can be obtained.
[0067] Finally, according to the target similarity between the pet noseprint image and each noseprint image template, the identity information of the pet is obtained. For example, the noseprint image template corresponding to the maximum target similarity is obtained, and the identity information corresponding to the noseprint image template is taken as the identity information of the pet.
[0068] It can be seen that when the recognition accuracy is high, i.e., the requirement for identity recognition is high, the pet noseprint image is intercepted, matched in different levels and layers, and not matched as a whole. Through multi-level matching, the accuracy of identity recognition can be improved.
[0069] Optionally, if the recognition accuracy is less than or equal to the third threshold, feature extraction is performed on the target image to obtain feature information, for example, the target image can be subjected to feature extraction by a trained neural network to obtain the feature information of the target image; identity recognition is performed according to the feature information to obtain the identity information of the pet. Similarly, the feature information of each pet noseprint image template can be obtained by performing feature extraction on each pet noseprint image template by the neural network. Finally, the feature information of the pet noseprint image is matched with the feature information of each noseprint image template to obtain the target similarity between the pet noseprint image and each noseprint image template; and the identity information of the pet is determined according to the target similarity between the pet noseprint image and each noseprint image template.
[0070] As can be seen, when the recognition accuracy is not high, i.e. when the requirement for identity recognition is not high, the pet noseprint image as a whole can be subjected to feature recognition and matching, thereby improving the efficiency of identity recognition.
[0071] As can be seen, in the embodiments of the present application, after obtaining the pet noseprint image, the pet noseprint image is not directly used for pet identity recognition, but at least one optimized mode suitable for the pet noseprint image is obtained first, the pet noseprint image is optimized to obtain a high-precision to-be-recognized image, and then the accuracy of subsequent pet identity recognition is improved. In addition, after obtaining the to-be-recognized image, the to-be-recognized image is not directly used for identity verification, but the to-be-recognized image is used to identify the identity of the pet in combination with the recognition accuracy corresponding to the current identity recognition requirement, i.e. the identity of the pet is identified in combination with the current recognition requirement, thereby further improving the accuracy of pet identity recognition.
[0072] Referring to Figure 6 , Figure 6 A flowchart of a target detection method provided by the embodiments of the present application is shown. The method includes but is not limited to the following steps:
[0073] 601: Obtain the species and feeding duration of the pet.
[0074] Illustratively, the pet identity recognition device is provided with an input-output device, so that the user can input the species and feeding duration of the pet to the pet identity recognition device through the input-output device.
[0075] 602: According to the species and the feeding duration, a target detection model corresponding to the pet noseprint image is called.
[0076] According to the category and the feeding time length, the pet identity recognition device determines a relative proportion of the nose of the pet in the pet noseprint image. According to the category of the pet, the pet identity recognition device obtains a growth rule of the pet. According to the growth rule of the pet and the feeding time length, a growth model of the pet is determined. That is, the pet grows according to the growth rule, and in a normal state, the growth model of the pet at the feeding time length is determined. The proportion of each organ on the head of the pet relative to the whole head in the growth model is obtained. The proportion of the nose relative to the whole head is taken as the relative proportion of the nose of the pet in the pet noseprint image. According to the relative proportion, a target detection model corresponding to the pet is called.
[0077] 603: Based on the target detection model, the category and the feeding time length, target detection is performed on the pet noseprint image to obtain a target region of the nose of the pet in the pet noseprint image.
[0078] Optionally, when the relative proportion is less than a first threshold value, the nose of the pet in the pet noseprint image is relatively small, and target detection can be performed on the pet noseprint image by a target detection model corresponding to the relative proportion. Such a target detection model is referred to as a first target detection model in the present application.
[0079] For example, a plurality of query vectors corresponding to the category are obtained, wherein each query vector is used to represent a facial feature corresponding to the pet of the category. For example, a query vector represents the nose feature of the pet of the category, and another query vector represents the eye feature of the pet. It should be noted that the plurality of query vectors are obtained by pre-training. In the present application, for each pet, a query vector corresponding to each pet is set, and the same query vector is not used for all pets. In this way, when target detection is performed on each pet, target detection can be performed in a targeted manner, thereby improving the efficiency and accuracy of target detection. Then, according to the category and the feeding time length, an association relationship between the facial organs of the pet is determined, wherein the association relationship mainly refers to the spatial position relationship between the facial organs.
[0080] For example, according to the category of the pet, initial relative distances and initial relative directions between the facial organs of the pet are determined, that is, the relative distances and relative directions between the facial organs of the pet when the pet is born. For example, the pet identity recognition device pre-stores the initial relative distances and initial relative directions between the facial organs of various pets. Then, according to the feeding time length, the initial relative distances and initial relative directions, and the growth rule of the pet of the category, the relative distances and relative directions between the facial organs of the pet at a time corresponding to the feeding time length are determined. According to the relative distances and relative directions between the facial organs at the time corresponding to the feeding time length, the association relationship is determined.
[0081] Optionally, the above-mentioned correlation can be represented by a three-dimensional matrix. As an example, the center of the pet's nose is taken as the coordinate origin of the three-dimensional coordinate system, and the relative direction and relative distance between the center of each facial organ and the center of the nose are obtained. Based on the relative direction and relative distance between the center of each facial organ and the center of the nose, the three-dimensional space coordinates of the center of each facial organ in the above-mentioned three-dimensional space coordinate system are determined. Finally, the above-mentioned three-dimensional matrix is constructed based on the three-dimensional space coordinates of each facial organ.
[0082] Specifically, the maximum value of the X-axis, the maximum value of the Y-axis, and the maximum value of the Z-axis in the three-dimensional space coordinates of the center of each facial organ are obtained. The maximum values of the X-axis, the Y-axis, and the Z-axis are x1, y1, and z1, respectively. Then, the maximum value of the X-axis is taken as the length of the three-dimensional space coordinates as the length of the above-mentioned three-dimensional matrix, the maximum value of the Y-axis is taken as the width of the above-mentioned three-dimensional matrix, and the maximum value of the Z-axis is taken as the height of the above-mentioned three-dimensional matrix, obtaining a three-dimensional matrix with length, width, and height of x1, y1, and z1, respectively. Finally, the three-dimensional matrix is segmented by taking values with an interval of 1, obtaining the space coordinates of each element in the three-dimensional matrix, and taking the distance between the space coordinates of each element relative to the coordinate origin as the value of each element, thereby obtaining the three-dimensional matrix for representing the above-mentioned correlation.
[0083] Finally, according to the correlation, the plurality of query vectors, and the target detection model, the target detection of the pet noseprint image is performed to obtain the target region of the pet's nose in the pet noseprint image.
[0084] Specifically, as shown in Figure 7 the first target detection model includes an encoding network, a feature extraction network, an encoder, and a decoder. As an example, based on the target detection model shown in Figure 7 According to the correlation, the feature extraction of the pet noseprint image is performed to obtain a plurality of first feature vectors. Specifically, the feature extraction of the pet noseprint image is performed to obtain a first feature map, i.e., the pet noseprint image is input into the feature extraction network for feature extraction to obtain the first feature map; the correlation is encoded to obtain a second feature map. As an example, the correlation is input into the encoding network for encoding to obtain the second feature map, i.e., the above-mentioned three-dimensional matrix is mapped to make the dimension of the obtained second feature map the same as the size (i.e., length and width) of the first feature map, so as to facilitate the subsequent fusion with the first feature map.
[0085] Further, the first feature map and the second feature map are fused to obtain a third feature map. It should be understood that the first feature map and the second feature map are both a three-dimensional matrix, and the length and the width are the same, so the first feature map and the second feature map can be spliced in the vertical direction (height) to obtain the third feature map. For example, the height of the first feature map is h1, and the height of the second feature map is h2, so the height of the third feature map obtained by splicing the first feature map and the second feature map is (h1+h2).
[0086] Further, the third feature map is tiled to obtain a plurality of first feature vectors. For example, the third feature map is tiled by height (by layer) to obtain a plurality of two-dimensional matrices. For example, the height of the third feature map is (h1+h2), so (h1+h2) two-dimensional matrices can be tiled, and the size of each two-dimensional matrix is the same, which is the size of the third feature map. Then, for each two-dimensional matrix, it is tiled by row or by column (mainly by row in this application). A plurality of one-dimensional sequences are obtained, wherein the number of elements of each one-dimensional sequence is the number of columns of the two-dimensional matrix, and the number of one-dimensional sequences is the number of rows of each two-dimensional matrix. For example, the size of each two-dimensional matrix is w*l, so after tiling by row, w one-dimensional sequences can be obtained, and the number of elements of each one-dimensional sequence is l. Finally, the plurality of one-dimensional sequences corresponding to each two-dimensional matrix are spliced to obtain a feature vector corresponding to each two-dimensional matrix, and the number of elements of the feature vector is w*l. Finally, each two-dimensional matrix corresponds to a first feature vector, and a plurality of first feature vectors are obtained. Therefore, for a third feature map with a size of w*l*(h1+h2), (h1+h2) first feature vectors with an element number of w*l can be tiled.
[0087] Further, the plurality of first feature vectors are input into an encoder for encoding to obtain a plurality of second feature vectors, wherein the encoding process can refer to the encoding process of the transform encoder, and will not be described again; then, the plurality of query vectors are input into a decoder for decoding to obtain a plurality of third feature vectors, wherein the decoding process can refer to the decoding process of the transform decoder, and will not be described again. Finally, target detection is performed according to each third feature vector to obtain a candidate box and a classification category corresponding to each third feature vector, that is, based on each third feature vector, the classification prediction and the candidate box prediction can be obtained. The candidate box and the classification category corresponding to each third feature vector.
[0088] Finally, according to the candidate box corresponding to each third feature vector and the classification category, the target candidate box is determined. That is, the classification category belonging to the nose is determined from the classification category corresponding to each third feature vector, and then the candidate box corresponding to the classification category is taken as the target candidate box. And the region framed by the target candidate box in the pet noseprint image is taken as the target region of the pet's nose in the pet noseprint image.
[0089] Optionally, when the relative proportion is greater than or equal to the first threshold value, the pet's nose in the pet noseprint image is relatively large, and then the pet noseprint image can be detected by the target detection model corresponding to the relative proportion. The target detection model is referred to as a second target detection model in the present application.
[0090] Referring to Figure 8 , Figure 8 A schematic diagram of the second target detection model is shown. The second target detection model includes a feature extraction network, a mapping layer, and a convolution layer. It should be noted that, unlike the first target detection model, before using the second target detection model, a plurality of reference boxes corresponding to each type of pet and a plurality of reference features need to be trained, wherein the plurality of reference boxes can roughly frame all the targets contained in the face image of the pet, and the plurality of reference features correspond to the plurality of reference boxes, and each reference feature is used to represent the features contained in the target framed by the reference feature corresponding to the reference feature.
[0091] For example, the pet noseprint image is subjected to feature extraction to obtain a first feature map, that is, the feature extraction network is input to perform feature extraction to obtain a first feature map. Then, a plurality of reference boxes and a plurality of reference features corresponding to the above type are obtained. It should be noted that in the present application, the reference boxes corresponding to each type of pet are trained, and the same reference boxes are not used for all pets, so that targeted target detection can be realized for each type of pet, and the accuracy of target detection is improved. Further, the candidate image corresponding to each reference box is cut from the first feature map.
[0092] It should be understood that the first feature map is a three-dimensional matrix obtained by splicing the feature maps extracted by each channel in the feature extraction network, so when the reference box is used to cut the image from the first feature map, it is essentially to cut the image from the feature map corresponding to each channel, and splice the plurality of images cut by the plurality of channels to obtain the candidate image corresponding to each candidate box. Therefore, the candidate image corresponding to each candidate box is also a three-dimensional matrix.
[0093] Further, the candidate image corresponding to each candidate box is input to the mapping layer for mapping to obtain a fourth feature map corresponding to each reference box, that is, the candidate image corresponding to each candidate box is input to the mapping layer to perform the ROI align operation, and the candidate image corresponding to each candidate box is mapped into a fifth feature map.
[0094] Further, the fourth feature map corresponding to each reference box is convoluted with the reference feature corresponding to each reference box to obtain a fifth feature map corresponding to each reference box. For example, as shown in FIG. 6, the reference feature corresponding to each reference box is mapped to obtain a two-dimensional matrix corresponding to each reference box, wherein the number of columns of the two-dimensional matrix is the same as the height of the fourth feature map corresponding to each reference box, so as to ensure that the dimension of the fifth feature vector is the same as the height of the fourth feature map, and wherein the number of rows of the two-dimensional matrix depends on the number of convolution kernels set by the convolution layer. Then, the two-dimensional matrix corresponding to each reference box is tiled to obtain a plurality of fifth feature vectors, wherein the dimension of each fifth feature vector is the same as the number of columns of the above-mentioned two-dimensional matrix; and the plurality of fifth feature vectors are used as convolution parameters of a plurality of convolution kernels, so that each fifth feature vector in the plurality of fifth feature vectors is used for convolution processing with the fourth feature map corresponding to each reference box to obtain a sub-feature map corresponding to each fifth feature vector; and the plurality of sub-feature maps corresponding to the plurality of fifth feature vectors are spliced to obtain a fifth feature map corresponding to each reference box. Therefore, the fifth feature map corresponding to each reference box is also a three-dimensional matrix. Figure 8 Finally, as shown in FIG. 6, the fifth feature map corresponding to each reference box is tiled to obtain a fourth feature vector corresponding to each reference box, wherein the tiling process of the fifth feature map is similar to the tiling process of the third feature map described above, and a two-dimensional matrix corresponding to the fifth feature map can be tiled, and then the two-dimensional matrix is tiled into a plurality of one-dimensional sequences. Different from the tiling of the third feature map, after the fifth feature map is tiled into a plurality of one-dimensional sequences, a long one-dimensional sequence is obtained from the plurality of one-dimensional sequences, and the long one-dimensional sequence is used as the fourth feature vector corresponding to each reference box.
[0095] Figure 8 Similarly, target detection is performed according to the fourth feature vector corresponding to each reference box to obtain a candidate box and a classification category corresponding to each reference box; the target candidate box is determined according to the candidate box and the classification category corresponding to each reference box; and a region framed by the target candidate box in the pet noseprint image is used as a target region.
[0096] Similarly, target detection is performed according to the fourth feature vector corresponding to each reference box to obtain a candidate box and a classification category corresponding to each reference box; the target candidate box is determined according to the candidate box and the classification category corresponding to each reference box; and a region framed by the target candidate box in the pet noseprint image is used as a target region.
[0097] It can be seen that, in the embodiment of the present application, before target detection is performed on the pet noseprint image, the category and feeding duration of the pet are acquired, and then a target detection model corresponding to the category and feeding duration is called. In this way, for different pets, a target detection model matched with the pet can be called to perform targeted target detection on the pet noseprint image, rather than using the same model for target detection on all pets, so that the segmentation accuracy of the pet nose is improved, and the target detection accuracy is improved.
[0098] Referring to Figure 9 , Figure 9 The pet identity recognition device provided in the embodiment of the present application includes a function unit composition block diagram. The pet identity recognition device 900 includes an acquisition unit 901 and a processing unit 902.
[0099] The acquisition unit 901 is configured to acquire a pet noseprint image and an identification accuracy corresponding to a current identity recognition requirement. The processing unit 902 is configured to determine at least one optimization mode corresponding to the pet noseprint image according to shooting information of the pet noseprint image and the pet noseprint image, optimize the pet noseprint image by using the at least one optimization mode to obtain a to-be-recognized image, perform target detection on the to-be-recognized image to obtain a target image, and perform identity recognition on the target image according to the identification accuracy to obtain identity information of the pet.
[0100] In some possible implementation manners of the present application, the shooting information includes environmental information when the pet noseprint image is shot. In the aspect of determining the at least one optimization mode corresponding to the pet noseprint image according to the shooting information of the pet noseprint image and the pet noseprint image, the processing unit 902 is specifically configured to determine the at least one optimization mode corresponding to the pet noseprint image according to the pet noseprint image and the environmental information. The at least one optimization mode includes one or more of denoising processing, enhancement processing, correction processing, and completion processing.
[0101] In some possible implementation manners of the present application, in the aspect of determining the at least one optimization mode corresponding to the pet noseprint image according to the pet noseprint image and the environmental information, the processing unit 902 is specifically configured to determine a content of environmental noise of the pet noseprint image according to the environmental information, determine that the at least one optimization mode includes denoising processing if the content is greater than a first threshold, determine the environmental brightness when the pet noseprint image is shot according to the environmental information, determine that the at least one optimization mode includes enhancement processing if the environmental brightness is less than a second threshold, determine that the at least one optimization mode includes correction processing if the pet noseprint image is inclined, and determine that the at least one optimization mode includes completion processing if the noseprint of the pet noseprint image is missing.
[0102] In some possible implementation of the present application, in the aspect of using the at least one optimization mode to optimize the pet noseprint image to obtain the to-be-identified image, the processing unit 902 is specifically configured to: obtain an optimization sequence of the at least one optimization mode; and use the at least one optimization mode to optimize the pet noseprint image according to the optimization sequence of the at least one optimization mode, to obtain the to-be-identified image.
[0103] In some possible implementation of the present application, in the aspect of performing identity recognition on the target image according to the recognition accuracy to obtain the identity information of the pet, the processing unit 902 is specifically configured to: if the recognition accuracy is greater than a third threshold, zoom the target image to a preset size to obtain a candidate image; obtain a preset radius and a preset offset value corresponding to the recognition accuracy; perform multiple times of cutting on the candidate image according to the preset radius and the preset offset value to obtain a plurality of sub-images; perform identity recognition according to the plurality of sub-images to obtain the identity information of the pet; and if the recognition accuracy is less than or equal to the third threshold, perform feature extraction on the target image to obtain feature information; and perform identity recognition according to the feature information to obtain the identity information of the pet.
[0104] In some possible implementation of the present application, in the aspect of performing multiple times of cutting on the candidate image according to the preset radius and the preset offset value to obtain a plurality of sub-images, the processing unit 902 is specifically configured to: offset the preset radius based on the preset offset value to obtain a plurality of cutting radii; take a center pixel point of the candidate image as a center, and cut the candidate image according to each cutting radius to obtain a plurality of circular images; and take each circular image as a sub-image to obtain the plurality of sub-images; wherein the i th cutting radius in the plurality of cutting radii satisfies the following formula:
[0105] r i = r0 + (i-1) * offset.
[0106] wherein r i is the i th cutting radius, r0 is the preset radius, offset is the preset offset value, i is an integer from 1 to N, and N is the number of the plurality of cutting radii.
[0107] In some possible implementation of the present application, in the aspect of performing target detection on the to-be-identified image to obtain a target image, the processing unit 902 is specifically configured to: obtain a kind of the pet and a feeding duration; and call a target detection model corresponding to the pet noseprint image according to the kind and the feeding duration.
[0108] perform target detection on the pet noseprint image based on the target detection model, the category, and the feeding duration, to obtain a target region of the pet's nose in the pet noseprint image;
[0109] cut an image corresponding to the target region from the pet noseprint image as a target image.
[0110] Referring to Figure 10 , Figure 10 A structural schematic diagram of an electronic device is provided in the embodiments of the present application. As shown in Figure 10 The electronic device 1000 includes a transceiver 1001, a processor 1002, and a memory 1003. They are connected through a bus 1004. The memory 1003 is used to store computer programs and data, and can transmit the data stored in the memory 1003 to the processor 1002.
[0111] The processor 1002 is used to read the computer programs in the memory 1003 to perform the following operations:
[0112] Control the transceiver 1001 to acquire a pet noseprint image and an identification accuracy corresponding to a current identification requirement;
[0113] According to the shooting information of the pet noseprint image and the pet noseprint image, determine at least one optimization mode corresponding to the pet noseprint image; optimize the pet noseprint image using the at least one optimization mode to obtain a to-be-identified image; perform target detection on the to-be-identified image to obtain a target image; and perform identity identification on the target image according to the identification accuracy to obtain identity information of a pet.
[0114] In some possible implementation manners of the present application, the shooting information includes environmental information when the pet noseprint image is shot; and in terms of determining at least one optimization mode corresponding to the pet noseprint image according to the shooting information of the pet noseprint image and the pet noseprint image, the processor 1002 is specifically configured to perform the following operation:
[0115] According to the pet noseprint image and the environmental information, determine at least one optimization mode corresponding to the pet noseprint image;
[0116] The at least one optimization mode includes one or more of denoising processing, enhancement processing, correction processing, and completion processing.
[0117] In some possible implementation manners of the present application, in terms of determining at least one optimization mode corresponding to the pet noseprint image according to the pet noseprint image and the environmental information, the processor 1002 is specifically configured to perform the following operation:
[0118] determine, according to the environment information, a content of environmental noise of the pet noseprint image;
[0119] if the content is greater than a first threshold, determine that the at least one optimization mode includes a de-noising process;
[0120] determine, according to the environment information, an environmental brightness when the pet noseprint image is captured;
[0121] if the environmental brightness is less than a second threshold, determine that the at least one optimization mode includes an enhancement process;
[0122] if the pet noseprint image is tilted, determine that the at least one optimization mode includes a correction process;
[0123] if the pet noseprint image is missing a noseprint, determine that the at least one optimization mode includes a completion process.
[0124] In some possible implementation manners of the present application, in the aspect of optimizing the pet noseprint image using the at least one optimization mode to obtain a to-be-identified image, the processor 1002 is specifically configured to perform the following operation:
[0125] obtain an optimization sequence of the at least one optimization mode;
[0126] optimize the pet noseprint image using the at least one optimization mode according to the optimization sequence of the at least one optimization mode, to obtain the to-be-identified image.
[0127] In some possible implementation manners of the present application, in the aspect of performing identity identification on the target image according to the identification accuracy to obtain identity information of the pet, the processor 1002 is specifically configured to perform the following operation:
[0128] if the identification accuracy is greater than a third threshold, scale the target image to a preset size to obtain a candidate image; obtain a preset radius and a preset offset value corresponding to the identification accuracy; perform multiple times of cutting on the candidate image according to the preset radius and the preset offset value to obtain multiple sub-images; perform identity identification according to the multiple sub-images to obtain the identity information of the pet;
[0129] if the identification accuracy is less than or equal to the third threshold, perform feature extraction on the target image to obtain feature information; perform identity identification according to the feature information to obtain the identity information of the pet.
[0130] In some possible implementation manners of the present application, in the aspect of performing multiple times of cutting on the candidate image according to the preset radius and the preset offset value to obtain multiple sub-images, the processor 1002 is specifically configured to perform the following operation:
[0131] Based on the preset offset value, the preset radius is offset to obtain multiple intercept radii;
[0132] Using the center pixel of the candidate image as the center, the candidate image is cropped with each cropping radius to obtain multiple circular images;
[0133] Each circular image is treated as a sub-image to obtain the plurality of sub-images;
[0134] Wherein, the i-th cutoff radius among the plurality of cutoff radii satisfies the following formula:
[0135] r i = r0 + (i-1) * offset;
[0136] Where, r i Let r0 be the i-th cutoff radius, r0 be the preset radius, offset be the preset offset value, i be an integer from 1 to N, and N be the number of multiple cutoff radii.
[0137] In some possible embodiments of this application, in order to perform target detection on the image to be identified and obtain a target image, the processor 1002 is specifically configured to perform the following operations:
[0138] Obtain the pet's species and feeding duration; based on the species and feeding duration, call the target detection model corresponding to the pet's nose print image; based on the target detection model, the species, and the feeding duration, perform target detection on the pet's nose print image to obtain the target region of the pet's nose in the pet's nose print image; extract the image corresponding to the target region from the pet's nose print image as the target image.
[0139] Specifically, the transceiver 1001 described above can be... Figure 9 The acquisition unit 901 of the pet identification device 900 in the embodiment described above, the processor 1002 can be... Figure 9 The processing unit 902 of the pet identification device 900 in the embodiment described above.
[0140] It should be understood that the electronic devices mentioned in this application may include smartphones (such as Android phones, iOS phones, Windows Phones, etc.), tablet computers, PDAs, laptops, mobile internet devices (MIDs), or wearable devices. The above-mentioned electronic devices are merely examples and not exhaustive, and include, but are not limited to, the electronic devices described above. In practical applications, the above-mentioned electronic devices may also include: intelligent in-vehicle terminals, computer equipment, etc.
[0141] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement part or all of steps of any pet identity identification method described in the above method embodiments.
[0142] The embodiment of the present application further provides a computer program product, which comprises a non-transitory computer readable storage medium storing a computer program. The computer program is operable to cause a computer to perform part or all of steps of any pet identity identification method described in the above method embodiments.
[0143] It should be noted that, for the above-mentioned method embodiments, in order to simply describe, they are all described as a combination of a series of actions, but those skilled in the art should know that the present application is not limited to the order of the actions described, because according to the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0144] In the above embodiments, the description of each embodiment is focused on, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0145] In several embodiments provided by the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic. The division of the units is only a logical function division. There can be another division manner in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different units, can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical or other forms.
[0146] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0147] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software program module.
[0148] The integrated unit, if implemented in the form of a software program module and sold or used as an independent product, can be stored in a computer readable memory. Based on such understanding, the technical solutions of the present application essentially or the part of the prior art that contributes to the present application or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a memory and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned memory includes: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0149] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by a program instructing relevant hardware, and the program can be stored in a computer readable memory, which can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0150] The embodiments of the present application are described in detail above, and the principles and implementation manners of the present application are described by applying specific examples. The above description of the embodiments is only used to help understand the method of the present application and its core idea; meanwhile, for those of ordinary skill in the art, according to the idea of the present application, the specific implementation manner and application range will be changed, and the above description of the embodiments should not be understood as a limitation of the present application.
Claims
1. A pet identification method, characterized by, The method comprises the following steps: acquiring a pet noseprint image and an identification accuracy corresponding to a current identification requirement; determining at least one optimization mode corresponding to the pet noseprint image according to shooting information of the pet noseprint image and the pet noseprint image; optimizing the pet noseprint image using the at least one optimization mode to obtain a to-be-identified image; performing target detection on the to-be-identified image to obtain a target image; performing identity identification on the target image according to the identification accuracy to obtain identity information of the pet, comprising: if the identification accuracy is greater than a third threshold, scaling the target image to a preset size to obtain a candidate image; acquiring a preset radius and a preset offset value corresponding to the identification accuracy; offsetting the preset radius based on the preset offset value to obtain a plurality of cutting radii; taking a center pixel point of the candidate image as a center, cutting the candidate image with each cutting radius to obtain a plurality of circular images; taking each circular image as a sub-image to obtain a plurality of sub-images; cutting each noseprint image template using the plurality of cutting radii to obtain a plurality of sub-noseprint image templates corresponding to each noseprint image template; for each cutting radius, matching a sub-image obtained by cutting the pet noseprint image using the cutting radius with a sub-template noseprint image obtained by cutting each noseprint image template using the cutting radius to obtain a similarity between the sub-image and the sub-template noseprint image; normalizing the plurality of cutting radii to obtain a weight corresponding to each cutting radius; weighting a plurality of similarities between the pet noseprint image and each noseprint image template under a plurality of cutting radii based on the weight corresponding to each cutting radius to obtain a target similarity between the pet noseprint image and each noseprint image template; and obtaining the identity information of the pet according to the target similarity between the pet noseprint image and each noseprint image template; if the identification accuracy is less than or equal to the third threshold, performing feature extraction on the target image to obtain feature information; and performing identity identification according to the feature information to obtain the identity information of the pet.
2. The method of claim 1, wherein, The shooting information comprises environmental information when the pet noseprint image is shot; and the at least one optimization mode corresponding to the pet noseprint image is determined according to the shooting information of the pet noseprint image and the pet noseprint image, comprising: determining the at least one optimization mode corresponding to the pet noseprint image according to the pet noseprint image and the environmental information; The at least one optimization mode comprises one or more of denoising processing, enhancement processing, correction processing and completion processing.
3. The method of claim 2, wherein, The at least one optimization mode corresponding to the pet noseprint image is determined according to the pet noseprint image and the environmental information, comprising: determining a content of environmental noise of the pet noseprint image according to the environmental information; if the content is greater than a first threshold, determining that the at least one optimization mode comprises denoising processing; determining environmental brightness when the pet noseprint image is shot according to the environmental information; If the ambient brightness is less than a second threshold value, it is determined that the at least one optimization mode includes enhanced processing; If the pet noseprint image is tilted, it is determined that the at least one optimization mode includes correction processing; If the pet noseprint image is missing a noseprint, it is determined that the at least one optimization mode includes completion processing.
4. The method according to claim 2 or 3, characterized in that, The optimization of the pet noseprint image using the at least one optimization mode includes: Obtaining an optimization order of the at least one optimization mode; According to the optimization order of the at least one optimization mode, the pet noseprint image is optimized using the at least one optimization mode to obtain the to-be-identified image.
5. The method according to any one of claims 1-4, characterized in that, The target detection of the to-be-identified image includes: Obtaining the species and feeding time of the pet; According to the species and the feeding time, a target detection model corresponding to the pet noseprint image is called; Based on the target detection model, the species, and the feeding time, the pet noseprint image is subjected to target detection to obtain a target region of the pet's nose in the pet noseprint image; An image corresponding to the target region is cut out from the pet noseprint image as a target image.
6. A pet identification device, comprising: It includes: An acquisition unit and a processing unit; The acquisition unit is configured to acquire a pet noseprint image and an identification accuracy corresponding to a current identity recognition requirement; The processing unit is configured to determine at least one optimization mode corresponding to the pet noseprint image according to shooting information of the pet noseprint image and the pet noseprint image, and optimize the pet noseprint image using the at least one optimization mode to obtain a to-be-identified image; The target detection of the to-be-identified image includes: According to the identification accuracy, the target image is subjected to identity recognition to obtain identity information of the pet, including: If the identification accuracy is greater than a third threshold value, the target image is scaled to a preset size to obtain a candidate image; a preset radius and a preset offset value corresponding to the identification accuracy are obtained; according to the preset radius and the preset offset value; based on the preset offset value, the preset radius is offset to obtain a plurality of cutting radii; the center pixel point of the candidate image is taken as the center, and each cutting radius is used to cut the candidate image to obtain a plurality of circular images; each circular image is taken as a sub-image to obtain a plurality of sub-images; each noseprint image template is cut using the plurality of cutting radii to obtain a plurality of sub-noseprint image templates corresponding to each noseprint image template; For each intercept radius, the sub-image obtained by intercepting the pet noseprint image using the intercept radius is matched with the sub-template noseprint image obtained by intercepting each noseprint image template using the intercept radius, to obtain the similarity between the sub-image and the sub-template noseprint image; the plurality of intercept radii are normalized to obtain the weight corresponding to each intercept radius; based on the weight corresponding to each intercept radius, the plurality of similarities between the pet noseprint image and each noseprint image template under the plurality of intercept radii are weighted to obtain a target similarity between the pet noseprint image and each noseprint image template; and the identity information of the pet is obtained according to the target similarity between the pet noseprint image and each noseprint image template. If the recognition accuracy is less than or equal to the third threshold, feature information is obtained by performing feature extraction on the target image; and the identity information of the pet is obtained by performing identity recognition according to the feature information.
7. An electronic device, comprising: Comprise: A processor and a memory, the processor being connected with the memory, the memory being used for storing a computer program, and the processor being used for executing the computer program stored in the memory, so that the electronic device executes the method in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method in any one of claims 1-5.
Citation Information
Patent Citations
Image processing method and device
CN110490118A
Universal scene character recognition method and device
CN111986155A
Pet nose print recognition method and device, computer equipment and storage medium
CN112434556A