Target identification method and system based on animal image features
Through the target recognition method based on animal image features, motion target detection and multi-dimensional feature analysis are used to generate animal feature templates and perform weighted matching, which solves the problems of low accuracy and poor robustness of animal recognition in complex scenes and achieves high-precision animal target recognition.
Patent Information
- Application Number
- CN202510712418.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-09-19
AI Technical Summary
Existing animal target recognition methods have low recognition accuracy and poor robustness in complex scenes, making it difficult to handle target recognition needs in dynamic images, and traditional systems cannot effectively extract animal features.
An animal feature recognition method based on animal image features is adopted. Through motion target detection, frame processing, image enhancement and multi-dimensional feature analysis, combined with directional gradient histogram and local binary pattern feature extraction, animal feature templates are generated, and recognition is performed through a weighted matching algorithm of cosine similarity and Euclidean distance.
It significantly improves the recognition accuracy and stability in complex environments, can accurately distinguish between animal subjects and backgrounds, overcome the effects of lighting changes and occlusions, and improves the system's adaptability and recognition accuracy in changing scenes.
Smart Images

Figure CN120673439A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision and artificial intelligence technology, and more specifically, to a target recognition method and system based on animal image features. Background Art
[0002] In the field of animal target recognition, with the continuous advancement of image acquisition technology, target recognition methods based on image features have gained widespread application. Existing animal target recognition methods primarily rely on extracting simple features from animal images, such as color and shape, and then comparing them with preset templates to achieve recognition. While these methods can meet basic recognition needs to a certain extent, they often suffer from low recognition accuracy and poor robustness when faced with complex animal image scenes. For example, animal images may contain background interference, lighting changes, and diverse animal postures, all of which can affect recognition accuracy. Furthermore, existing recognition systems are generally unable to effectively extract the characteristics of the target animal when processing dynamic images, resulting in low recognition efficiency.
[0003] In the process of implementing the embodiments of the present invention, the inventors found that there are at least the following problems or defects in the existing technology: the existing technology cannot effectively handle the feature extraction of animal images in complex scenes, it is difficult to meet the needs of target recognition in dynamic images, and the recognition accuracy and robustness need to be improved. Summary of the Invention
[0004] The present invention provides a target recognition method and system based on animal image features.
[0005] In a first aspect of the present invention, a method for object recognition based on animal image features is provided, comprising:
[0006] In response to an animal image acquisition request obtained by an image acquisition device, parsing the animal image acquisition request to obtain animal feature information corresponding to the animal image acquisition request;
[0007] Acquiring animal image data captured by the image acquisition device;
[0008] generating an animal feature template according to the animal image data;
[0009] Displaying a feature configuration interface corresponding to the animal feature template, wherein the animal feature template and a storage time configuration control are displayed in the feature configuration interface;
[0010] storing the animal feature template according to the configured storage time information corresponding to the storage time configuration control;
[0011] In response to obtaining an image of an animal to be identified by the target identification device, matching processing is performed on the image of the animal to be identified according to each stored animal feature template to obtain a matching result;
[0012] In response to determining that the matching result indicates a successful match, the object recognition device is controlled to perform a recognition result output operation.
[0013] Furthermore, the animal characteristic information includes animal category identification and collection location information;
[0014] Before acquiring the animal image data acquired by the image acquisition device, the method further includes:
[0015] In response to detecting a selection operation of a capture control on an image capture request page, obtaining, based on the capture location information, a location address of an image capture device corresponding to the animal image capture request, wherein the image capture request page corresponds to the animal image capture request and displays the animal category name included in the animal characteristic information on the image capture request page;
[0016] Determining whether the image acquisition device location address meets the location conditions corresponding to the preset acquisition area;
[0017] In response to determining that the location address of the image acquisition device satisfies the location condition, sending an acquisition permission request corresponding to the animal image acquisition request to the image acquisition device;
[0018] And the obtaining of animal image data acquired by the image acquisition device comprises:
[0019] In response to receiving feedback information corresponding to the acquisition permission request indicating that the acquisition is agreed, the animal image data acquired by the image acquisition device is acquired.
[0020] Furthermore, generating an animal feature template based on the animal image data includes: performing effective area detection processing on the animal image data to obtain an effective area detection result;
[0021] In response to determining that the effective area detection result indicates that a target animal area exists, an animal feature template is generated based on the animal image data.
[0022] Furthermore, the animal image acquisition request is a dynamic image acquisition request, and the animal image data is a dynamic image sequence; and performing effective area detection processing on the animal image data to obtain an effective area detection result includes:
[0023] Performing motion target detection on the dynamic image sequence to obtain a motion target detection result as a valid area detection result.
[0024] Furthermore, generating an animal feature template based on the animal image data includes: performing frame processing on the dynamic image sequence to obtain a static image sequence;
[0025] For each static image in the static image sequence, the following steps are performed: determining whether a complete animal target region exists in the static image;
[0026] In response to determining that a complete animal target region exists in the static image, performing a clipping process on the animal target region in the static image to obtain an animal target image;
[0027] Performing clarity detection on the animal target image to obtain target image clarity information;
[0028] Performing texture complexity detection on the animal target image to obtain texture information of the target image;
[0029] Performing color distribution detection on the animal target image to obtain target image color information;
[0030] generating target image parameters according to the target image clarity information, the target image texture information, and the target image color information;
[0031] According to the obtained target image parameters, an animal target image that meets the preset characteristic parameter conditions is selected from the obtained animal target images as a target characteristic image;
[0032] performing image enhancement processing on the target feature image according to target image clarity information, target image texture information, and target image color information corresponding to the target feature image to obtain an enhanced target image;
[0033] performing feature extraction processing on the enhanced target image to obtain animal image feature information;
[0034] An animal feature template is generated according to the animal image feature information and the animal category identifier.
[0035] Furthermore, the performing of clarity detection on the animal target image to obtain target image clarity information includes: performing grayscale processing on the animal target image to obtain a target grayscale image;
[0036] Eliminate each pixel point that meets a preset edge condition in the animal target image to obtain a target image after elimination;
[0037] For each pixel point in the target grayscale image, the following steps are performed: determining a pixel point in the target grayscale image that is right adjacent to the pixel point as a right adjacent pixel point;
[0038] Determine a pixel point in the target grayscale image that is upper-adjacent to the pixel point as an upper-adjacent pixel point;
[0039] generating a first pixel difference value according to a pixel value of the right adjacent pixel point and a pixel value of the pixel point;
[0040] generating a second pixel difference value according to the pixel value of the upper adjacent pixel point and the pixel value of the pixel point;
[0041] Determine the sum of squares of the obtained first pixel difference values and the obtained second pixel difference values as the gradient square sum;
[0042] Determine the number of each pixel point included in the target grayscale image as the total number of pixel points;
[0043] The ratio of the gradient square sum to the total number of pixels is determined as target image clarity information corresponding to the animal target image.
[0044] Furthermore, performing image enhancement processing on the target feature image according to the target image clarity information, target image texture information, and target image color information corresponding to the target feature image to obtain an enhanced target image includes:
[0045] In response to determining that the target image clarity information corresponding to the target feature image meets a preset clarity enhancement condition, performing a sharpening process on the target feature image to update the target feature image;
[0046] In response to determining that the target image texture information corresponding to the target feature image meets a preset texture enhancement condition, performing texture enhancement processing on the target feature image to update the target feature image;
[0047] In response to determining that the target image color information corresponding to the target feature image satisfies a preset color balance condition, performing color correction processing on the target feature image to update the target feature image;
[0048] performing a size normalization process on the updated target feature image to update the target feature image;
[0049] The updated target feature image is determined as the enhanced target image.
[0050] Furthermore, the animal image acquisition request is a static image acquisition request, and the animal image data is a static image;
[0051] And performing effective area detection processing on the animal image data to obtain an effective area detection result includes:
[0052] Performing edge contour detection on the static image to obtain a contour detection result as a valid area detection result; and generating an animal feature template based on the animal image data, including: performing background segmentation processing on the static image to obtain a segmented target image;
[0053] performing noise filtering on the segmented target image to obtain a denoised target image;
[0054] Performing region division processing on the denoised target image to obtain multiple local regions;
[0055] For each of the plurality of local areas, performing the following steps: determining a contrast corresponding to the local area;
[0056] determining the shape integrity corresponding to the local area;
[0057] In response to determining that the contrast and the shape integrity satisfy a preset rejection condition, rejecting the local area from the multiple local areas to update the local area set;
[0058] Performing feature extraction processing on each local region in the updated local region set to obtain local feature information;
[0059] For any two pieces of local feature information obtained, determining similarity information of the two pieces of local feature information;
[0060] Selecting similarity information that meets a preset similarity condition from the determined similarity information as target similarity information;
[0061] The two local feature information corresponding to the target similarity information and the animal category identifier are determined as an animal feature template.
[0062] Furthermore, performing feature extraction processing on each local area in the updated local area set to obtain local feature information includes:
[0063] Performing directional gradient histogram feature extraction on the local area to obtain a first eigenvector;
[0064] Performing local binary pattern feature extraction on the local area to obtain a second feature vector;
[0065] fusing the first eigenvector and the second eigenvector to obtain a fused eigenvector;
[0066] generating local feature information according to the fused feature vector and the animal category identifier;
[0067] And the determining of the similarity information of any two local feature information includes:
[0068] Performing cosine similarity calculation on the fused feature vectors corresponding to the arbitrary two local feature information to obtain a first similarity value;
[0069] Performing Euclidean distance calculation on the fused feature vectors corresponding to any two local feature information to obtain a second similarity value;
[0070] A weighted sum of the first similarity value and the second similarity value is determined as similarity information.
[0071] In a second aspect of the present invention, a target recognition system based on animal image features is provided, comprising:
[0072] a request parsing module, configured to, in response to an animal image acquisition request obtained by an image acquisition device, parse the animal image acquisition request to obtain animal feature information corresponding to the animal image acquisition request;
[0073] A data acquisition module, configured to acquire the animal image data acquired by the image acquisition device;
[0074] A template generation module, used for generating an animal feature template based on the animal image data;
[0075] An interface display module, configured to display a feature configuration interface corresponding to the animal feature template, wherein the animal feature template and a storage time configuration control are displayed in the feature configuration interface;
[0076] A storage configuration module, configured to store the animal feature template according to the configured storage time information corresponding to the storage time configuration control;
[0077] a matching processing module for, in response to an image of an animal to be identified being acquired by the target recognition device, performing matching processing on the image of the animal to be identified according to each stored animal feature template to obtain a matching result;
[0078] The control execution module is used to control the target recognition device to perform a recognition result output operation in response to determining that the matching result indicates a successful match.
[0079] The above embodiments of the present invention have at least the following beneficial effects:
[0080] 1. The motion target detection technology of dynamic image sequences can accurately capture the movement characteristics of animals and eliminate static background interference. Combined with the effective area detection algorithm of static images, it can intelligently distinguish the animal body from the complex environmental background. It effectively solves the problems of misidentification and missed identification caused by background clutter, target occlusion or light changes in traditional image recognition methods in the wild or dynamic scenes, and significantly improves the accuracy and stability of target detection.
[0081] 2. The use of multi-dimensional feature analysis technology, including clarity assessment based on gradient calculation, complexity detection based on texture analysis, and distribution feature extraction based on color histogram, can comprehensively characterize the visual characteristics of animal targets. At the same time, combined with adaptive image enhancement algorithms (such as sharpening, texture enhancement, and color correction), it can effectively overcome the influence of different lighting conditions, shooting angles, or partial occlusion on feature extraction, ensuring that stable and reliable feature data can still be obtained in complex environments, greatly improving the system's adaptability in changing scenarios.
[0082] 3. By integrating the dual feature extraction strategy of histogram of oriented gradients (HOG) features and local binary pattern (LBP) features, and combining it with a weighted matching algorithm based on cosine similarity and Euclidean distance, the macro-contour features and micro-texture features of animal targets can be captured simultaneously, significantly improving the ability to distinguish between similar species or different individuals of the same species, and effectively solving the mismatching problem caused by appearance similarity in the traditional single feature recognition method in animal individual recognition, so that the system has higher recognition accuracy and generalization ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily apparent by reading the following detailed description with reference to the accompanying drawings, in which several embodiments of the present invention are shown by way of example and not limitation, in which:
[0084] Figure 1 A schematic flow chart of a method for object recognition based on animal image features provided by one embodiment of the present invention;
[0085] Figure 2 A schematic diagram of the structure of a target recognition system based on animal image features provided by one embodiment of the present invention;
[0086] Figure 3 The figure schematically shows the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0087] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided solely to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. Rather, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.
[0088] Those skilled in the art will appreciate that the embodiments of the present invention may be implemented as a system, apparatus, device, method, or computer program product. Therefore, the present invention may be implemented in the following forms: entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software.
[0089] It should be noted that any number of elements in the drawings is for illustration only and not for limitation, and any naming is only for distinction and does not have any limiting meaning.
[0090] Reference below Figure 1 , Figure 1 Schematic diagram of a flow chart of a target recognition method based on animal image features provided by an embodiment of the present invention. Figure 1 As shown, a target recognition method based on animal image features includes:
[0091] S1. In response to an animal image acquisition request obtained by an image acquisition device, parsing the animal image acquisition request to obtain animal feature information corresponding to the animal image acquisition request;
[0092] S2. Acquire animal image data collected by the image acquisition device;
[0093] S3. generating an animal feature template based on the animal image data;
[0094] S4. Displaying a feature configuration interface corresponding to the animal feature template, wherein the feature configuration interface displays the animal feature template and a storage time configuration control;
[0095] S5. storing the animal feature template according to the configured storage time information corresponding to the storage time configuration control;
[0096] S6. In response to obtaining an image of an animal to be identified by the target recognition device, performing matching processing on the image of the animal to be identified according to each stored animal feature template to obtain a matching result;
[0097] S7. In response to determining that the matching result indicates a successful match, control the target recognition device to perform a recognition result output operation.
[0098] It should be noted that when the image acquisition device receives an animal image acquisition request, the system first parses the request to obtain the animal's characteristic information. This animal characteristic information refers to specific identifiers associated with the animal, such as species, color, and morphology. This information helps the system preliminarily determine the type and scope of animal images to be collected. After acquiring the animal image data, the system generates an animal characteristic template based on this data. This template serves as a key reference for the subsequent recognition process and contains core features of the animal image, such as texture, shape, and color distribution. The feature configuration interface allows users to further configure and adjust the generated animal characteristic template, such as setting parameters such as storage time, to better adapt it to different recognition needs and scenarios. The storage time configuration control allows users to set the storage duration of the characteristic template according to actual needs. This is very important in practical applications, as different recognition tasks have different requirements for the storage time of characteristic templates. When the target recognition device obtains the image of the animal to be identified, the system will perform matching processing based on the stored animal feature template. The matching process is completed by comparing the similarity between the image to be identified and the feature template. If the match is successful, the recognition result output operation is executed. The output operation can be to display the recognition result, trigger an alarm, or perform other preset actions, which depends on the specific application scenario and user needs.
[0099] Specifically, an animal image acquisition request is a user- or system-initiated instruction requesting an image acquisition device to capture images of a specific animal. This request includes key parameters such as the animal category identifier and acquisition location information. The animal category identifier specifies the type of animal to be captured, such as a cat, dog, or other animal. This is crucial for subsequent image processing and feature extraction. The acquisition location information specifies the specific location for image acquisition, helping the system determine the image acquisition device's location address, ensuring that the captured image meets the requirements. The image acquisition device's location address refers to the device's specific spatial coordinates. These coordinates can be used to determine whether the device is within the preset acquisition area. Only when the device is within the permitted acquisition area is acquisition permission granted. A dynamic image sequence is a series of continuous image frames that capture the animal's movement. Dynamic image processing typically requires techniques such as moving target detection to accurately extract the animal's valid area. Static image processing refers to a single image. Static image processing primarily focuses on operations such as edge contour detection and background segmentation to extract the target area of the animal. Generating an animal's signature template involves a series of operations, including valid area detection, background segmentation, noise filtering, and region partitioning. These operations aim to extract the core features of the animal in the image for subsequent matching and recognition. Matching is accomplished by comparing the similarity between the image to be identified and the signature template. This similarity can be calculated based on a variety of feature parameters, such as texture, color, and shape. The specific calculation method can be selected and adjusted based on actual needs.
[0100] Preferably, during the process of generating the animal feature template, multiple feature extraction algorithms can be employed to improve the template's accuracy and robustness. For example, for a dynamic image sequence, motion target detection can be performed first. The animal's motion region can be determined by analyzing the differences between image frames. The detected motion regions can then be frame-by-frame processed to generate a static image sequence. For each static image, further operations such as clarity detection, texture complexity detection, and color distribution detection can be performed to generate target image parameters. These parameters can include image clarity, texture feature vectors, and color distribution histograms, which can more comprehensively describe the characteristics of the animal target. When selecting the target feature image, the most suitable image can be selected from multiple animal target images based on preset feature parameter conditions, such as clarity threshold, texture complexity range, and color distribution similarity. For image enhancement of the target feature image, sharpening, texture enhancement, and color correction can be performed based on the target image's clarity, texture, and color information, respectively, to improve image quality and recognizability. During the matching process, a variety of similarity calculation methods, such as cosine similarity and Euclidean distance, can be used to compare the feature vectors of the feature template and the image to be identified, so as to obtain more accurate matching results.
[0101] In some embodiments, the animal characteristic information includes an animal category identifier and collection location information; and before obtaining the animal image data collected by the image collection device, the method further includes:
[0102] In response to detecting a selection operation of a capture control on an image capture request page, obtaining, based on the capture location information, a location address of an image capture device corresponding to the animal image capture request, wherein the image capture request page corresponds to the animal image capture request and displays the animal category name included in the animal characteristic information on the image capture request page;
[0103] Determining whether the image acquisition device location address meets the location conditions corresponding to the preset acquisition area;
[0104] In response to determining that the image acquisition device location address satisfies the location condition, sending a collection permission request corresponding to the animal image collection request to the image acquisition device; and obtaining the animal image data collected by the image acquisition device, including:
[0105] In response to receiving feedback information corresponding to the acquisition permission request indicating that the acquisition is agreed, the animal image data acquired by the image acquisition device is acquired.
[0106] It should be noted that when a user selects the capture control on the image capture request page, the system obtains the image capture device's location address based on the capture location information. This location information refers to the geographic location data included in the animal image capture request, which is used to determine whether the image capture device's installation location meets the preset capture area requirements. The image capture request page is a user interface through which users can initiate animal image capture requests. It displays information such as the animal category name, allowing users to clearly understand the specifics of the capture request. The image capture device's location address refers to the device's specific location coordinates in geographic space, typically obtained using GPS or other positioning technologies. The system determines whether this location address meets the preset capture area requirements. If so, it sends a capture permission request to the image capture device. When the image capture device responds with consent for capture, the system obtains the animal image data it has captured. This process ensures that the image capture device is authorized to capture animal images only within the designated area, thereby ensuring the validity and reliability of the image data.
[0107] Specifically, the capture control is an interactive button or option on the image capture request page. Users initiate a capture request by clicking or selecting this control. Capture location information typically includes geographic coordinate data such as longitude and latitude, which accurately identifies the installation location of the image capture device. A preset capture area is a geographic range predefined by the user or the system, such as a specific wildlife sanctuary or experimental area. An image capture device is considered a valid capture location only when its location address is within this area. A capture permission request is a signal generated by the system and sent to the image capture device, requesting the device to begin capturing animal images. Feedback information is a response signal returned by the image capture device after receiving the capture permission request, indicating whether the device agrees to perform the capture operation. If the device returns feedback indicating that it agrees to the capture operation, the system will obtain the animal image data captured by the device. This data can be static images or dynamic image sequences, depending on the requirements of the capture request.
[0108] Preferably, a high-precision GPS positioning module can be used to obtain the image acquisition device's location address. This module can acquire the device's longitude and latitude coordinates in real time and transmit the coordinate data to the system with a certain degree of accuracy, such as several decimal places. The preset acquisition area can be a polygonal area whose boundaries are defined by a series of coordinate points. The system can determine whether the location condition is met by determining whether the image acquisition device's location address is within the area enclosed by these coordinate points. The acquisition permission request can include the device's unique identifier, the acquisition request timestamp, and specific acquisition task parameters, such as the acquired image resolution and acquisition duration. Feedback information can be a simple confirmation signal or include device status information, such as battery level and storage space, to enable the system to assess the device's status before acquiring animal image data. When acquiring animal image data, the system can select appropriate image acquisition parameters based on the acquisition request type (static or dynamic). For example, for dynamic image acquisition, parameters such as frame rate and exposure time can be set to ensure that the acquired image data meets the requirements of subsequent processing and analysis.
[0109] In some embodiments, generating an animal feature template based on the animal image data includes:
[0110] Performing effective area detection processing on the animal image data to obtain an effective area detection result;
[0111] In response to determining that the effective area detection result indicates that a target animal area exists, an animal feature template is generated based on the animal image data.
[0112] It should be noted that the process of generating animal feature templates first requires effective area detection processing of the animal image data. Effective area detection processing refers to the use of image processing technology to identify the area containing the target animal from the animal image data, thereby excluding irrelevant information such as background. Animal image data refers to the original image information collected by the image acquisition device, which can be a static image or a dynamic image sequence. Only when the presence of the target animal area is detected will the animal feature template be further generated. This process ensures the accuracy and relevance of the feature template and avoids misidentification caused by factors such as background interference. In this way, the system can more efficiently extract the core features of the animal image, providing a reliable foundation for subsequent recognition and matching.
[0113] Specifically, effective area detection processing is an image processing technology used to identify target animal areas in images. This process can be implemented through a variety of algorithms, such as target detection algorithms based on edge detection, contour recognition, or deep learning. In this embodiment, the detection result characterizes whether there is a target animal area, that is, it determines whether the image contains an animal area that meets preset characteristics, such as shape, texture, color, etc. Animal image data refers to the original image information collected by the image acquisition device, which can be a static image or a dynamic image sequence. The target animal area refers to the part of the image that actually contains the animal. This area usually has texture, color, and shape characteristics that are different from the background. During the detection process, the system will determine which areas in the image belong to the target animal area based on preset feature parameters, such as the animal's outline, texture pattern, etc. If the detection result shows that there is a target animal area, the system will further process these areas to generate an animal feature template.
[0114] Preferably, a convolutional neural network (CNN) model from deep learning can be used when performing effective area detection. This model is trained by inputting a large number of labeled animal images to learn the various characteristic manifestations of animals in the images. During the actual detection process, the collected animal image data is input into the trained CNN model, and the model outputs information about the location and size of the target animal area in the image. For example, the model can output the bounding box coordinates of the target animal area, such as the coordinates of the upper left and lower right corners, thereby clearly identifying the target animal area in the image. When generating an animal feature template, feature parameters such as texture, color, and shape of the detected target animal area can be further extracted from the area. For example, the target animal area can be grayscaled and then its texture feature vector can be calculated; at the same time, the color distribution histogram of the area can be statistically analyzed to obtain color feature information. These feature parameters together constitute the animal feature template, which is used in the subsequent matching and recognition processes.
[0115] In some embodiments, the animal image acquisition request is a dynamic image acquisition request, and the animal image data is a dynamic image sequence; and performing effective area detection processing on the animal image data to obtain an effective area detection result includes:
[0116] Performing motion target detection on the dynamic image sequence to obtain a motion target detection result as a valid area detection result.
[0117] It should be noted that when the animal image acquisition request is a dynamic image acquisition request, the collected animal image data is a dynamic image sequence. A dynamic image sequence refers to a series of continuous image frames that can capture the movement of the animal. When performing effective area detection processing on the dynamic image sequence, a motion target detection method is used to obtain a motion target detection result as the effective area detection result. Motion target detection is to identify moving objects by analyzing the changes in pixels in the image sequence, thereby determining the position and range of the target animal. This method is particularly suitable for processing dynamic scenes, and can effectively distinguish the difference between the animal and the background, thereby improving the accuracy of target detection.
[0118] Specifically, a dynamic image sequence is a group of images taken continuously by an image acquisition device within a certain period of time, and each image is called a frame. Motion target detection is the process of identifying moving objects based on the changes in pixels in a dynamic image sequence. In this embodiment, the motion target detection result is used as the effective area detection result to determine whether the target animal area exists in the image sequence. Motion target detection is usually achieved by calculating the difference between adjacent frames. For example, the grayscale value difference of each pixel between two frames of images can be calculated. When the difference exceeds a certain threshold, the pixel is considered to belong to a moving target. In addition, more advanced motion detection algorithms such as optical flow method can be used to more accurately identify moving targets by analyzing the movement direction and speed of pixels. In actual applications, the parameter settings of motion target detection, such as the size of the threshold, the size of the detection window, etc., need to be adjusted according to the specific scene and the movement characteristics of the animal.
[0119] Preferably, when performing moving target detection, an algorithm based on background subtraction can be used. The algorithm first needs to establish a background model, which is obtained by statistically analyzing the pixel values of the non-moving parts in the dynamic image sequence. During the actual detection process, each frame of the image is compared with the background model, and the difference between each pixel and the background model is calculated. If the difference exceeds a preset threshold, the pixel is considered to belong to the moving target. The key to the background subtraction method lies in the establishment and updating of the background model. The background model needs to be able to adapt to changes in the environment, such as changes in lighting, slow movement of background objects, etc. The background model can be established by averaging multiple frames in the image sequence or using methods such as Gaussian mixture models, and the background model can be dynamically updated during the detection process to improve the accuracy and robustness of the detection. In addition, in order to further improve the accuracy of moving target detection, morphological operations such as dilation and erosion can be combined to remove noise and small interference areas, thereby obtaining a clearer target animal area.
[0120] In some embodiments, generating an animal feature template based on the animal image data includes:
[0121] Performing frame processing on the dynamic image sequence to obtain a static image sequence;
[0122] For each static image in the static image sequence, the following steps are performed: determining whether a complete animal target region exists in the static image;
[0123] In response to determining that a complete animal target region exists in the static image, performing a clipping process on the animal target region in the static image to obtain an animal target image;
[0124] Performing clarity detection on the animal target image to obtain target image clarity information;
[0125] Performing texture complexity detection on the animal target image to obtain texture information of the target image;
[0126] Performing color distribution detection on the animal target image to obtain target image color information;
[0127] generating target image parameters according to the target image clarity information, the target image texture information, and the target image color information;
[0128] According to the obtained target image parameters, an animal target image that meets the preset characteristic parameter conditions is selected from the obtained animal target images as a target characteristic image;
[0129] performing image enhancement processing on the target feature image according to target image clarity information, target image texture information, and target image color information corresponding to the target feature image to obtain an enhanced target image;
[0130] performing feature extraction processing on the enhanced target image to obtain animal image feature information;
[0131] An animal feature template is generated according to the animal image feature information and the animal category identifier.
[0132] It should be noted that when the animal image acquisition request is a dynamic image acquisition request, the collected animal image data is a dynamic image sequence. In order to generate the animal feature template, the system will perform a series of processing on the dynamic image sequence, including frame processing, target area detection, image parameter calculation, feature image selection, image enhancement, and feature extraction. The purpose of these steps is to extract high-quality, representative animal features from the dynamic image sequence, thereby improving the accuracy and reliability of subsequent recognition. Through these processes, the system can better adapt to the complexity of animal images in dynamic scenes and ensure that the feature template can accurately reflect the characteristics of the target animal.
[0133] Specifically, a dynamic image sequence is a set of images captured continuously over a period of time by an image acquisition device, with each image being called a frame. Frame processing involves breaking down the dynamic image sequence into individual static image frames so that each frame can be processed independently. For each static image frame, the system detects whether a complete target animal region exists. This can be achieved through edge detection, contour analysis, or deep learning algorithms to ensure that the extracted region contains the complete animal image. Image parameter calculation includes sharpness, texture complexity, and color distribution testing, which are used to assess image quality and feature information. Sharpness testing assesses image sharpness by calculating image gradient information; texture complexity testing assesses image complexity by analyzing texture patterns; and color distribution testing statistically analyzes the distribution of colors within the image. Feature image selection involves selecting the most suitable image from multiple candidate images based on preset feature parameter conditions as the target feature image. Image enhancement processing includes operations such as sharpening, texture enhancement, and color correction to improve image quality and recognizability. Finally, feature extraction extracts feature information used for identification, such as texture and shape features, from the enhanced target image. This information is then combined with the animal category identifier to generate an animal feature template.
[0134] Preferably, clarity detection in image parameter calculation can be achieved by calculating the ratio of the image's sum of squared gradients to the total number of pixels. Specifically, the image is first grayscaled, and then the grayscale value difference between each pixel and its adjacent pixels is calculated to obtain the sum of squared gradients. The sum of squared gradients is divided by the total number of pixels to obtain clarity information. Texture complexity detection can be achieved by calculating the image's local binary pattern (LBP) features, which can effectively describe the image's texture information. Color distribution detection can be achieved by calculating the image's color histogram, which can reflect the distribution of different colors in the image. During feature image selection, the most suitable image can be screened from multiple candidate images based on conditions such as clarity threshold, texture complexity range, and color distribution similarity. Sharpening in image enhancement can be achieved by applying the Laplacian operator to enhance the image's edge information; texture enhancement can be achieved by applying a texture enhancement algorithm to highlight the image's texture features; and color correction can be achieved by adjusting the image's hue, saturation, and brightness to make the image's colors more uniform and natural. Finally, the feature extraction process can use the HOG feature extraction algorithm of the Histogram of Directed Gradients, combined with the Local Binary Pattern (LBP) feature, to generate a fused feature vector as the core feature information of the animal feature template.
[0135] In some embodiments, performing clarity detection on the animal target image to obtain target image clarity information includes:
[0136] grayscale processing is performed on the animal target image to obtain a target grayscale image;
[0137] Eliminate each pixel point that meets a preset edge condition in the animal target image to obtain a target image after elimination;
[0138] For each pixel point in the target grayscale image, the following steps are performed: determining a pixel point in the target grayscale image that is right adjacent to the pixel point as a right adjacent pixel point;
[0139] Determine a pixel point in the target grayscale image that is upper-adjacent to the pixel point as an upper-adjacent pixel point;
[0140] generating a first pixel difference value according to a pixel value of the right adjacent pixel point and a pixel value of the pixel point;
[0141] generating a second pixel difference value according to the pixel value of the upper adjacent pixel point and the pixel value of the pixel point;
[0142] Determine the sum of squares of the obtained first pixel difference values and the obtained second pixel difference values as the gradient square sum;
[0143] Determine the number of each pixel point included in the target grayscale image as the total number of pixel points;
[0144] The ratio of the gradient square sum to the total number of pixels is determined as target image clarity information corresponding to the animal target image.
[0145] It should be noted that clarity testing of animal target images is performed to assess image quality and ensure that subsequent processing is based on high-quality images. Clarity testing obtains target image clarity information through a series of computational steps, including grayscale processing, edge pixel removal, and calculation of the sum of squared gradients of the pixels. Ultimately, the image clarity is quantified by determining the ratio of the sum of squared gradients to the total number of pixels. This method effectively distinguishes clear animal target images from blurred ones, providing a reliable basis for subsequent image processing and feature extraction.
[0146] Specifically, the target animal image refers to an image region containing an animal captured from a dynamic image sequence. Grayscaling is the process of converting a color image into a grayscale image. By converting the RGB values of each pixel into grayscale values, the data volume is reduced and subsequent processing is simplified. Edge pixel removal is performed to remove potential noise or interference in the image. Preset edge conditions, such as pixel gradients or positional information, are used to determine which pixels to remove. The sum of squared gradients is calculated by calculating the grayscale value difference between each pixel and its neighbors. Specifically, the grayscale value difference between the right-adjacent pixel and the current pixel is calculated as the first pixel difference, and the grayscale value difference between the upper-adjacent pixel and the current pixel is calculated as the second pixel difference. The squared sum of the first and second pixel differences for all pixels is then added together to obtain the gradient sum. The total number of pixels refers to the total number of pixels in the target grayscale image. Finally, the sharpness information is obtained by dividing the gradient sum by the total number of pixels. A higher value indicates a sharper image.
[0147] Preferably, when performing clarity detection, the image can be preprocessed, such as by removing noise through median filtering, to improve the accuracy of clarity detection. In the grayscale processing, a weighted average method can be used to convert the RGB values into grayscale values according to certain weights, for example, grayscale value = 0.299R + 0.587G + 0.114B. This method can better preserve the visual information of the image. When calculating pixel differences, a threshold can be introduced. Only when the pixel difference exceeds the threshold is the pixel considered to contribute to the sum of squared gradients, thereby avoiding the influence of small noise. In addition, to further improve the robustness of clarity detection, the image can be normalized before calculating the sum of squared gradients, so that the pixel values are distributed between 0 and 1, thereby eliminating the differences in pixel value ranges between different images. The resulting clarity information can be used for subsequent image screening and processing. For example, only when the clarity information is above a preset threshold is the animal target image used for feature extraction and template generation.
[0148] In some embodiments, performing image enhancement processing on the target feature image according to target image clarity information, target image texture information, and target image color information corresponding to the target feature image to obtain an enhanced target image includes:
[0149] In response to determining that the target image clarity information corresponding to the target feature image meets a preset clarity enhancement condition, performing a sharpening process on the target feature image to update the target feature image;
[0150] In response to determining that the target image texture information corresponding to the target feature image meets a preset texture enhancement condition, performing texture enhancement processing on the target feature image to update the target feature image;
[0151] In response to determining that the target image color information corresponding to the target feature image satisfies a preset color balance condition, performing color correction processing on the target feature image to update the target feature image;
[0152] performing a size normalization process on the updated target feature image to update the target feature image;
[0153] The updated target feature image is determined as the enhanced target image.
[0154] It should be noted that image enhancement processing of the target feature image is intended to improve image quality and feature recognizability, thereby increasing the accuracy and reliability of subsequent recognition. Image enhancement processing includes sharpening, texture enhancement, color correction, and size normalization. These processing steps are determined based on the clarity, texture, and color information of the target image, ultimately generating an enhanced target image. Through these enhancement processes, the system can better highlight the characteristics of the target animal, making it easier to identify and match.
[0155] Specifically, the target feature image is an image that is screened from multiple candidate images and meets the preset feature parameter conditions, and is used for subsequent feature extraction and recognition. The clarity enhancement condition means that when the clarity information of the target image is lower than the preset threshold, sharpening processing is required to improve the sharpness of the image. The texture enhancement condition means that when the texture information of the target image does not meet the preset texture complexity requirements, texture enhancement processing is required to highlight the texture features. The color balance condition means that when the color distribution of the target image does not meet the preset color standard, color correction processing is required to adjust the color distribution. Sharpening processing improves the clarity of the image by enhancing the edge information of the image; texture enhancement processing highlights the texture features by enhancing the texture contrast of the image; color correction processing optimizes the color performance by adjusting the hue, saturation and brightness of the image. Size normalization processing is to adjust the image to a uniform size for subsequent processing and matching. These processing steps ensure the quality of the target image in terms of clarity, texture and color, providing a better foundation for subsequent feature extraction and recognition.
[0156] Preferably, when performing sharpening processing, the Laplace operator or Gaussian sharpening algorithm can be used. The Laplace operator enhances edge information by calculating the second-order derivative of the image, and is suitable for scenes where image details need to be highlighted. The Gaussian sharpening algorithm combines Gaussian smoothing and sharpening operations, which can enhance edges while reducing the impact of noise. Texture enhancement processing can be achieved by applying texture enhancement algorithms, such as texture enhancement methods based on wavelet transform, which can effectively enhance the texture details of the image. Color correction processing can be achieved by adjusting the hue, saturation and brightness of the image. For example, the brightness distribution of the image can be adjusted by using the histogram equalization method to make the color of the image more uniform and natural. Size normalization processing can be achieved by bilinear interpolation or nearest neighbor interpolation methods to adjust the image to a preset uniform size, such as 256×256 pixels. In practical applications, the parameters of these enhancement processing methods can be flexibly selected and adjusted according to the specific characteristics and recognition requirements of the target animal image to achieve the best enhancement effect.
[0157] In some embodiments, the animal image acquisition request is a static image acquisition request, and the animal image data is a static image; and performing effective area detection processing on the animal image data to obtain an effective area detection result includes:
[0158] Performing edge contour detection on the static image to obtain a contour detection result as a valid area detection result; and generating an animal feature template based on the animal image data, including: performing background segmentation processing on the static image to obtain a segmented target image;
[0159] performing noise filtering on the segmented target image to obtain a denoised target image;
[0160] Performing region division processing on the denoised target image to obtain multiple local regions;
[0161] For each of the plurality of local areas, performing the following steps: determining a contrast corresponding to the local area;
[0162] determining the shape integrity corresponding to the local area;
[0163] In response to determining that the contrast and the shape integrity satisfy a preset rejection condition, rejecting the local area from the multiple local areas to update the local area set;
[0164] Performing feature extraction processing on each local region in the updated local region set to obtain local feature information;
[0165] For any two pieces of local feature information obtained, determining similarity information of the two pieces of local feature information;
[0166] Selecting similarity information that meets a preset similarity condition from the determined similarity information as target similarity information;
[0167] The two local feature information corresponding to the target similarity information and the animal category identifier are determined as an animal feature template.
[0168] It should be noted that when the animal image acquisition request is for a static image, the collected animal image data is a single static image. To generate the animal feature template, the system performs a series of processing on the static image, including edge contour detection, background segmentation, noise filtering, region partitioning, feature extraction, and similarity calculation. These processing steps are designed to extract high-quality animal features from the static image, ensuring that the feature template accurately reflects the characteristics of the target animal, thereby improving the accuracy and reliability of subsequent recognition.
[0169] Specifically, a static image refers to a single image of an animal, typically containing both the animal and its background. Edge and outline detection uses image processing algorithms to identify the edges and outlines of objects in an image. Common methods include the Canny edge detection algorithm. Background segmentation separates the animal target from the background in an image. Common methods include threshold-based segmentation or region growing-based segmentation. Noise removal removes noise from an image using filtering algorithms. Common methods include median filtering or Gaussian filtering. Region partitioning divides the segmented target image into multiple local regions for more detailed feature analysis. The contrast and shape integrity of each local region are assessed by calculating its grayscale difference and geometric shape integrity. If the contrast and shape integrity of a local region do not meet preset conditions, it is removed from the set of local regions. Feature extraction extracts feature information from the remaining local regions, such as the Histogram of Oriented Gradients (HOG) feature and the Local Binary Pattern (LBP) feature. Similarity calculation evaluates the degree of match between two local feature information by comparing their similarity. Common methods include cosine similarity and Euclidean distance.
[0170] Preferably, edge contour detection can adopt the Canny algorithm, which detects edges by calculating the gradient amplitude and direction of the image, and removes weak edges by the double threshold method to obtain a clear edge contour. Background segmentation can be achieved by setting a grayscale threshold to divide the pixels in the image into two categories: target and background. Noise filtering can adopt median filtering, which removes noise by replacing the pixel value with the median of the surrounding pixels while retaining the edge information of the image. Region partitioning can be performed based on the geometric shape of the image, for example, dividing the image into multiple rectangular regions of equal size. In feature extraction, HOG feature extraction can be achieved by calculating the directional gradient histogram of the image, and LBP feature extraction can be achieved by analyzing the local texture pattern of the image. In similarity calculation, cosine similarity evaluates the similarity of two feature vectors by calculating the cosine value of the angle between them, and Euclidean distance evaluates the similarity of two feature vectors by calculating the distance between them. Finally, the two similarity values are combined by weighted sum to obtain comprehensive similarity information, so that the local feature information that best meets the requirements is selected as part of the animal feature template.
[0171] In some embodiments, performing feature extraction processing on each local area in the updated local area set to obtain local feature information includes:
[0172] Performing directional gradient histogram feature extraction on the local area to obtain a first eigenvector;
[0173] Performing local binary pattern feature extraction on the local area to obtain a second feature vector;
[0174] fusing the first eigenvector and the second eigenvector to obtain a fused eigenvector;
[0175] generating local feature information according to the fused feature vector and the animal category identifier;
[0176] And the determining of the similarity information of any two local feature information includes:
[0177] Performing cosine similarity calculation on the fused feature vectors corresponding to the arbitrary two local feature information to obtain a first similarity value;
[0178] Performing Euclidean distance calculation on the fused feature vectors corresponding to any two local feature information to obtain a second similarity value;
[0179] A weighted sum of the first similarity value and the second similarity value is determined as similarity information.
[0180] It should be noted that the process of feature extraction processing of local areas in this embodiment is intended to generate local feature information that can accurately describe the characteristics of animal targets. Through the HOG feature extraction of the histogram of oriented gradients and the LBP feature extraction of the local binary pattern, the two feature vectors are fused to form a more comprehensive feature representation. Subsequently, the similarity of any two local feature information is calculated by cosine similarity and Euclidean distance, and finally the similarity information that meets the preset similarity conditions is selected as the target similarity information for constructing the animal feature template. This process improves the accuracy and robustness of the feature template by integrating multiple feature extraction methods and similarity calculation methods, providing a more reliable basis for subsequent animal target recognition.
[0181] Specifically, Histogram of Oriented Gradients (HOG) feature extraction is a feature extraction method based on image gradient information. It calculates the gradient direction and magnitude of each pixel in the image and generates a gradient histogram to describe the image's texture features. Local Binary Pattern (LBP) feature extraction is a feature extraction method based on local texture patterns. It compares the grayscale values of the central pixel with those of its neighbors to generate a binary pattern to describe local texture features. Fusion feature vectors combine HOG and LBP feature vectors to form a more comprehensive feature representation, improving feature descriptive capabilities. Cosine similarity measures the similarity between two feature vectors by calculating the cosine of the angle between them. A value closer to 1 indicates higher similarity. Euclidean distance measures the similarity between two feature vectors by calculating the distance between them. A smaller distance indicates higher similarity. Similarity information is a weighted sum of the results of cosine similarity and Euclidean distance to produce a comprehensive similarity value, which is used to assess the degree of similarity between two local feature information.
[0182] Preferably, when performing HOG feature extraction, the image can be divided into multiple small cells, a gradient histogram is calculated within each cell, and then the histograms of all cells are concatenated to form the final HOG feature vector. For example, the image can be divided into 8×8 pixel cells, and the gradient histograms in nine directions are calculated for each cell. When performing LBP feature extraction, a uniform LBP mode can be used. This mode generates an 8-bit binary number to describe local texture features by comparing the grayscale values of the central pixel with those of its eight surrounding pixels. When fusing feature vectors, the HOG and LBP feature vectors can be normalized to eliminate scale differences between the different feature vectors. When calculating similarity information, the results of the cosine similarity and Euclidean distance can be weighted and summed. For example, the cosine similarity can be multiplied by a weight coefficient, such as 0.6, and the Euclidean distance can be multiplied by another weight coefficient, such as 0.4. The two results can then be added together to obtain the combined similarity information. This approach can better balance the advantages of the two similarity calculation methods and improve the accuracy of similarity assessment.
[0183] The above embodiments of the present invention have the following beneficial effects:
[0184] 1. The motion target detection technology of dynamic image sequences can accurately capture the movement characteristics of animals and eliminate static background interference. Combined with the effective area detection algorithm of static images, it can intelligently distinguish the animal body from the complex environmental background. It effectively solves the problems of misidentification and missed identification caused by background clutter, target occlusion or light changes in traditional image recognition methods in the wild or dynamic scenes, and significantly improves the accuracy and stability of target detection.
[0185] 2. The use of multi-dimensional feature analysis technology, including clarity assessment based on gradient calculation, complexity detection based on texture analysis, and distribution feature extraction based on color histogram, can comprehensively characterize the visual characteristics of animal targets. At the same time, combined with adaptive image enhancement algorithms (such as sharpening, texture enhancement, and color correction), it can effectively overcome the influence of different lighting conditions, shooting angles, or partial occlusion on feature extraction, ensuring that stable and reliable feature data can still be obtained in complex environments, greatly improving the system's adaptability in changing scenarios.
[0186] 3. By integrating the dual feature extraction strategy of histogram of oriented gradients (HOG) features and local binary pattern (LBP) features, and combining it with a weighted matching algorithm based on cosine similarity and Euclidean distance, the macro-contour features and micro-texture features of animal targets can be captured simultaneously, significantly improving the ability to distinguish between similar species or different individuals of the same species, and effectively solving the mismatching problem caused by appearance similarity in the traditional single feature recognition method in animal individual recognition, so that the system has higher recognition accuracy and generalization ability.
[0187] like Figure 2 As shown, some embodiments provide a target recognition system based on animal image features, the system comprising:
[0188] A request parsing module 201 is configured to, in response to an animal image acquisition request obtained by an image acquisition device, parse the animal image acquisition request to obtain animal feature information corresponding to the animal image acquisition request;
[0189] A data acquisition module 202 is used to acquire animal image data acquired by the image acquisition device;
[0190] The template generation module 203 is used to generate an animal feature template based on the animal image data;
[0191] An interface display module 204 is configured to display a feature configuration interface corresponding to the animal feature template, wherein the animal feature template and a storage time configuration control are displayed in the feature configuration interface;
[0192] A storage configuration module 205, configured to store the animal feature template according to the configured storage time information corresponding to the storage time configuration control;
[0193] The matching processing module 206 is configured to, in response to the image of the animal to be identified being acquired by the target recognition device, perform matching processing on the image of the animal to be identified according to the stored animal feature templates to obtain a matching result;
[0194] The control execution module 207 is configured to control the target recognition device to execute a recognition result output operation in response to determining that the matching result indicates a successful match.
[0195] It is understandable that the modules recorded in the target recognition system based on animal image features are similar to those in the reference Figure 1 The steps in the target recognition method based on animal image features described above correspond to each other. Therefore, the operations, features and beneficial effects described above for the target recognition method based on animal image features are also applicable to the target recognition system based on animal image features and the modules contained therein, and will not be repeated here.
[0196] Reference below Figure 3 , which shows a schematic structural diagram of an electronic device 300 suitable for implementing some embodiments of the present invention. The electronic devices in some embodiments of the present invention may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 3 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0197] like Figure 3 As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. Various programs and data required for the operation of the electronic device 300 are also stored in the RAM 303. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0198] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Figure 3 The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead. Figure 3 Each block shown in the figure may represent one device, or may represent multiple devices as needed.
[0199] Furthermore, the storage medium of the embodiment of the present application stores program instructions that can implement all the above methods, wherein the program instructions can be stored in the above storage medium in the form of a software product, including a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or a terminal device such as a computer, a server, a mobile phone, or a tablet.
[0200] The above descriptions are merely some preferred embodiments of the present invention and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present invention is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also encompass other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned inventive concept. For example, a technical solution formed by mutually replacing the above-mentioned features with (but not limited to) technical features having similar functions disclosed in the embodiments of the present invention.
Claims
1. A target recognition method based on animal image features, comprising: In response to an animal image acquisition request obtained by an image acquisition device, parsing the animal image acquisition request to obtain animal feature information corresponding to the animal image acquisition request; Acquiring animal image data captured by the image acquisition device; generating an animal feature template according to the animal image data; Displaying a feature configuration interface corresponding to the animal feature template, wherein the animal feature template and a storage time configuration control are displayed in the feature configuration interface; storing the animal feature template according to the configured storage time information corresponding to the storage time configuration control; In response to obtaining an image of an animal to be identified by the target identification device, matching processing is performed on the image of the animal to be identified according to each stored animal feature template to obtain a matching result; In response to determining that the matching result indicates a successful match, the object recognition device is controlled to perform a recognition result output operation.
2. The method according to claim 1, wherein The animal characteristic information includes animal category identification and collection location information; Before acquiring the animal image data acquired by the image acquisition device, the method further includes: In response to detecting a selection operation of a capture control on an image capture request page, obtaining, based on the capture location information, a location address of an image capture device corresponding to the animal image capture request, wherein the image capture request page corresponds to the animal image capture request and displays the animal category name included in the animal characteristic information on the image capture request page; Determining whether the image acquisition device location address meets the location conditions corresponding to the preset acquisition area; In response to determining that the image acquisition device location address satisfies the location condition, sending a collection permission request corresponding to the animal image collection request to the image acquisition device; and obtaining the animal image data collected by the image acquisition device, including: In response to receiving feedback information corresponding to the acquisition permission request indicating that the acquisition is agreed, the animal image data acquired by the image acquisition device is acquired.
3. The method according to claim 2, wherein: Generating an animal feature template according to the animal image data includes: Performing effective area detection processing on the animal image data to obtain an effective area detection result; In response to determining that the effective area detection result indicates that a target animal area exists, an animal feature template is generated based on the animal image data.
4. The method according to claim 3, wherein: The animal image acquisition request is a dynamic image acquisition request, and the animal image data is a dynamic image sequence; And the performing effective area detection processing on the animal image data to obtain an effective area detection result includes: performing moving target detection on the dynamic image sequence to obtain the moving target detection result as the effective area detection result.
5. The method according to claim 4, wherein Generating an animal feature template according to the animal image data includes: Performing frame processing on the dynamic image sequence to obtain a static image sequence; For each static image in the static image sequence, the following steps are performed: determining whether a complete animal target region exists in the static image; In response to determining that a complete animal target region exists in the static image, performing a clipping process on the animal target region in the static image to obtain an animal target image; Performing clarity detection on the animal target image to obtain target image clarity information; Performing texture complexity detection on the animal target image to obtain texture information of the target image; Performing color distribution detection on the animal target image to obtain target image color information; generating target image parameters according to the target image clarity information, the target image texture information, and the target image color information; According to the obtained target image parameters, an animal target image that meets the preset characteristic parameter conditions is selected from the obtained animal target images as a target characteristic image; performing image enhancement processing on the target feature image according to target image clarity information, target image texture information, and target image color information corresponding to the target feature image to obtain an enhanced target image; performing feature extraction processing on the enhanced target image to obtain animal image feature information; An animal feature template is generated according to the animal image feature information and the animal category identifier.
6. The method according to claim 5, wherein: The performing clarity detection on the animal target image to obtain target image clarity information includes: grayscale processing is performed on the animal target image to obtain a target grayscale image; Eliminate each pixel point that meets a preset edge condition in the animal target image to obtain a target image after elimination; For each pixel point in the target grayscale image, the following steps are performed: determining a pixel point in the target grayscale image that is right adjacent to the pixel point as a right adjacent pixel point; Determine a pixel point in the target grayscale image that is upper-adjacent to the pixel point as an upper-adjacent pixel point; generating a first pixel difference value according to a pixel value of the right adjacent pixel point and a pixel value of the pixel point; generating a second pixel difference value according to the pixel value of the upper adjacent pixel point and the pixel value of the pixel point; Determine the sum of squares of the obtained first pixel difference values and the obtained second pixel difference values as the gradient square sum; Determine the number of each pixel point included in the target grayscale image as the total number of pixel points; The ratio of the gradient square sum to the total number of pixels is determined as target image clarity information corresponding to the animal target image.
7. The method according to claim 5, wherein: The step of performing image enhancement processing on the target feature image according to target image clarity information, target image texture information, and target image color information corresponding to the target feature image to obtain an enhanced target image includes: In response to determining that the target image clarity information corresponding to the target feature image meets a preset clarity enhancement condition, performing a sharpening process on the target feature image to update the target feature image; In response to determining that the target image texture information corresponding to the target feature image meets a preset texture enhancement condition, performing texture enhancement processing on the target feature image to update the target feature image; In response to determining that the target image color information corresponding to the target feature image satisfies a preset color balance condition, performing color correction processing on the target feature image to update the target feature image; performing a size normalization process on the updated target feature image to update the target feature image; The updated target feature image is determined as the enhanced target image.
8. The method according to claim 3, wherein: The animal image acquisition request is a static image acquisition request, and the animal image data is a static image; And performing effective area detection processing on the animal image data to obtain an effective area detection result includes: Performing edge contour detection on the static image to obtain a contour detection result as a valid area detection result; and generating an animal feature template based on the animal image data, including: Performing background segmentation processing on the static image to obtain a segmented target image; performing noise filtering on the segmented target image to obtain a denoised target image; Performing region division processing on the denoised target image to obtain multiple local regions; For each of the plurality of local areas, performing the following steps: determining a contrast corresponding to the local area; determining the shape integrity corresponding to the local area; In response to determining that the contrast and the shape integrity satisfy a preset rejection condition, rejecting the local area from the multiple local areas to update the local area set; Performing feature extraction processing on each local region in the updated local region set to obtain local feature information; For any two pieces of local feature information obtained, determining similarity information of the two pieces of local feature information; Selecting similarity information that meets a preset similarity condition from the determined similarity information as target similarity information; The two local feature information corresponding to the target similarity information and the animal category identifier are determined as an animal feature template.
9. The method according to claim 8, wherein The step of performing feature extraction on each local area in the updated local area set to obtain local feature information includes: Performing directional gradient histogram feature extraction on the local area to obtain a first eigenvector; Performing local binary pattern feature extraction on the local area to obtain a second feature vector; fusing the first eigenvector and the second eigenvector to obtain a fused eigenvector; generating local feature information according to the fused feature vector and the animal category identifier; And the determining of the similarity information of any two local feature information includes: Performing cosine similarity calculation on the fused feature vectors corresponding to the arbitrary two local feature information to obtain a first similarity value; Performing Euclidean distance calculation on the fused feature vectors corresponding to any two local feature information to obtain a second similarity value; A weighted sum of the first similarity value and the second similarity value is determined as similarity information.
10. A target recognition system based on animal image features, characterized in that: include: a request parsing module, configured to, in response to an animal image acquisition request obtained by an image acquisition device, parse the animal image acquisition request to obtain animal feature information corresponding to the animal image acquisition request; A data acquisition module, configured to acquire the animal image data acquired by the image acquisition device; A template generation module, used for generating an animal feature template based on the animal image data; An interface display module, configured to display a feature configuration interface corresponding to the animal feature template, wherein the animal feature template and a storage time configuration control are displayed in the feature configuration interface; A storage configuration module, configured to store the animal feature template according to the configured storage time information corresponding to the storage time configuration control; a matching processing module for, in response to an image of an animal to be identified being acquired by the target recognition device, performing matching processing on the image of the animal to be identified according to each stored animal feature template to obtain a matching result; The control execution module is used to control the target recognition device to perform a recognition result output operation in response to determining that the matching result indicates a successful match.