Activity target identity information identification method, generation method, device and storage medium

Through the identity recognition method based on surface texture, the identification line is constructed and the texture feature information is extracted, and the problem of low accuracy of cow identity recognition in the prior art in complex environments is solved, and high-accuracy cow identity recognition is achieved.

CN117058715BActive Publication Date: 2025-04-18CAMHIECH TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311031774.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-16
Publication Date
2025-04-18
Estimated Expiration
2043-08-16

AI Technical Summary

Technical Problem

Existing vision-based non-invasive dairy cow identity recognition technology is susceptible to factors such as shooting angle, light and fur contamination in complex pasture environments, resulting in low recognition accuracy.

Method used

The surface texture-based identity information recognition method is adopted, and the identity feature information of the active target is identified by constructing the attribute information of the edge intersection point of multiple recognition lines and the surface image, and the identity information of the active target is extracted, and the identity information of the active target is identified.

Benefits of technology

The algorithm instability problem is effectively solved in complex pasture environments, the accuracy of cow identity recognition is improved, and high-accurate activity target identity recognition is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117058715B_ABST
    Figure CN117058715B_ABST
Patent Text Reader

Abstract

The present application relates to a method, generation method, device and storage medium for identifying the identity information of an active target based on surface texture. The method for identifying the identity information of an active target based on surface texture includes: constructing multiple first identification lines of the active target based on the collected first surface image and first depth data of the active target; extracting the identity feature information of the active target based on the attribute information of the intersections of the multiple first identification lines and the edges of each texture area of ​​the first surface image; performing feature matching on the identity feature information of the active target based on a pre-established identity information feature library to identify the identity information of the active target. The present application implements a non-invasive identity recognition based on vision, which can achieve high-accuracy identity recognition of active targets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of agricultural artificial intelligence, and in particular to a method, a generation method, a device and a storage medium for identifying identity information of an active target based on surface texture. Background Art

[0002] Cow identification refers to the individual identification of a cow while it is moving in the cowshed. It mainly collects, extracts and compares the characteristics of the cow to determine the cow's identity information (such as number, gender, date of birth, etc.). The importance of cow identification in animal husbandry lies in that it can help farmers provide personalized services to cows in various production links and achieve refined management of pastures. For example, sick cows can be grouped; special formula feed can be given to specific cows, etc.

[0003] Common cow identification is divided into invasive identification and non-invasive identification. Identification based on electronic ear tags, collars and other types of equipment requires cows to wear equipment identification, which is an invasive identification method. The equipment cost of this method is high and difficult to maintain. Most ranches only have one-third of cows wearing it. Non-invasive identification can use non-contact identification based on vision, using the cow's coat color and pattern as identification features. There is no need to wear equipment, no contact, and low equipment cost.

[0004] At present, in vision-based non-invasive identity recognition, the algorithms for analyzing fur color images widely use LBP feature extraction, SURF feature extraction, HU distance contour similarity and other algorithms. Although these algorithms are widely used in image feature extraction and comparison, they are easily affected by various factors such as shooting angle, lighting, fur pollution, etc. in the complex production environment of ranches. There is still algorithm instability, making it difficult to achieve high-accuracy identity recognition, and practical applications are still very challenging. Summary of the invention

[0005] In order to solve the above technical problems or at least partially solve the problems of low identity recognition accuracy in the above vision-based non-invasive identity recognition, the present application provides a method, a generation method, a device and a storage medium for identifying identity information of an active target based on surface texture.

[0006] In a first aspect, the present application provides a method for identifying identity information of an active target based on surface texture, the method for identifying identity information of an active target based on surface texture comprising:

[0007] Constructing a plurality of first identification lines of the moving target according to the collected first surface image and first depth data of the moving target;

[0008] Extracting identity feature information of the active target according to attribute information of intersections between the plurality of first identification lines and edges of each texture region of the first surface image;

[0009] According to a pre-established identity information feature library, feature matching is performed on the identity feature information of the activity target to identify the identity information of the activity target.

[0010] Optionally, constructing a plurality of first identification lines of the moving target according to the collected first surface image and first depth data of the moving target includes:

[0011] Collecting a first surface image and first depth data of a moving target below the collecting device according to an image and depth data collecting device pre-set above the identification channel;

[0012] In the effective recognition area of ​​the first surface image, determining the center line of the moving object according to the first depth data, and constructing a plurality of elliptical lines on both sides of the center line of the moving object respectively;

[0013] The center line of the moving object and the elliptical lines on both sides of the center line are used as a plurality of first identification lines of the moving object.

[0014] Optionally, the acquisition device includes a color camera and a depth camera; the horizontal distance between the color camera and the depth camera is no greater than a preset width, and the deployment heights are the same;

[0015] The collecting of the first surface image and the first depth data of the moving target below the collecting device according to the image and depth data collecting device pre-set above the identification channel comprises:

[0016] Triggering the color camera and the depth camera to perform synchronous acquisition, so that the color camera acquires the first surface image, and the depth camera acquires the first depth data;

[0017] Determine the highest point positions at both ends of the moving target according to the first depth data;

[0018] Determine the center line of the moving target according to the highest point positions at both ends of the moving target;

[0019] determining whether the first surface image is a valid image according to a horizontal relative distance between a center line of the moving target and a center line of the first surface image in the same direction;

[0020] When it is determined that the image is a valid image, a valid identification area of ​​the first surface image is determined according to the first surface image and / or the first depth data.

[0021] Optionally, extracting the identity feature information of the active target according to the attribute information of the intersections between the plurality of first identification lines and the edges of each texture region of the first surface image includes:

[0022] Determine, according to the two end points of each first identification line, the intersection attribute information of each first identification line and each texture area of ​​the first surface image; the attribute information of any intersection includes the position information of the intersection and the color transformation information of the intersection;

[0023] Constructing a feature vector of each first identification line according to the attribute information of each intersection point of each first identification line;

[0024] Constructing a first eigenvector matrix of the moving target according to the eigenvectors of the plurality of first identification lines;

[0025] The first feature vector matrix of the activity target is used as the identity feature information of the activity target.

[0026] Optionally, constructing a feature vector of each first identification line according to the attribute information of each intersection of each first identification line includes:

[0027] Determine the position information of each intersection point of each first identification line according to the relative position between each intersection point of the first identification line and the first end point of the first identification line;

[0028] According to the direction from the first end point to the second end point of each first identification line, determine the color transformation information of each intersection point where the first identification line passes through;

[0029] According to the position information and color transformation information of each intersection point of the first identification line, a two-dimensional vector of each intersection point of the first identification line is constructed to generate a feature vector of each first identification line.

[0030] Optionally, performing feature matching on the identity feature information of the activity target according to a pre-established identity information feature library to identify the identity information of the activity target includes:

[0031] Determining the station type corresponding to the first eigenvector matrix according to the positional relationship between the center line of the moving target and the center line of the first surface image in the same direction;

[0032] Determine from the identity information feature database each identity identification feature matrix of the same station type as the first feature vector matrix;

[0033] The identity information of the activity target is identified based on the similarity between the first feature vector matrix and each identity identification feature matrix of the same station type.

[0034] Optionally, the station type includes a middle station type, a relatively left station type, and a relatively right station type;

[0035] The identifying the identity information of the activity target according to the similarity between the first feature vector matrix and each identity identification feature matrix of the same station type includes:

[0036] Determine the eigenvector difference between each eigenvector of each identification line of each identity identification feature matrix of the same station type and the first eigenvector matrix;

[0037] According to the feature vector differences of each feature vector of each identification line, in each identity feature matrix of the same station type, determining the identity feature matrix having the smallest matrix difference with the first feature vector matrix;

[0038] The identity information of the activity target is identified according to the identity identification feature matrix with the smallest matrix difference.

[0039] In a second aspect, the present application provides a method for generating identity information of an active target based on surface texture, the method for generating identity information of an active target based on surface texture comprising:

[0040] constructing a plurality of second identification lines of the active sample according to the collected second surface image and second depth data of the active sample;

[0041] Extracting identity feature information of the activity sample according to attribute information of intersections between the plurality of second identification lines and edges of each texture region of the second surface image;

[0042] An identity information feature library of multiple activity samples is constructed according to the identity feature information of multiple activity samples.

[0043] In a third aspect, the present application provides an electronic device, the electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor;

[0044] When the computer program is executed by the processor, the steps of the method for identifying the identity information of an active target based on surface texture as described above are implemented, or the steps of the method for generating the identity information of an active target based on surface texture as described above are implemented.

[0045] In a fourth aspect, the present application provides a computer-readable storage medium, on which is stored a program for identifying an active target identity information based on surface texture and / or a program for generating active target identity information based on surface texture;

[0046] When the program for identifying the identity information of an active target based on surface texture is executed by a processor, the steps of the method for identifying the identity information of an active target based on surface texture as described in any one of the above items are implemented;

[0047] When the program for generating the identity information of an active target based on surface texture is executed by a processor, the steps of the method for generating the identity information of an active target based on surface texture as described above are implemented.

[0048] The above technical solution provided by this application has the following advantages compared with the prior art:

[0049] The present application realizes a non-invasive identity recognition based on vision, and effectively solves the problem that algorithms such as LBP feature extraction, SURF feature extraction, HU distance contour similarity are easily interfered by various factors such as shooting angle, lighting, fur pollution, etc. in the complex production environment of ranches. It effectively solves the instability problem of the above algorithms and can realize high-accuracy identity recognition of moving targets. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0052] Figure 1 This is a flow chart of a method for identifying identity information of an active target based on surface texture according to various embodiments of the present application;

[0053] Figure 2a A schematic diagram of the shooting positions of the color camera C1 and the depth camera C2 deployed when identifying identity information in various embodiments of the present application;

[0054] Figure 2b A schematic diagram of the shooting positions of the color camera C1 and the depth camera C2 deployed when establishing the identity feature library in each embodiment of the present application;

[0055] Figure 3a This is a schematic diagram of the cow's body being difficult to distinguish from the ground in various embodiments of the present application;

[0056] Figure 3b This is a schematic diagram of the overlapping boundaries of the cow's body that are difficult to distinguish in various embodiments of the present application;

[0057] Figure 4A schematic diagram of the position of a cow obtained by CNN-based object detection in various embodiments of the present application;

[0058] Figure 5 A schematic diagram of accurately capturing the position of the coccyx and shoulder blade of a cow based on the depth camera data in various embodiments of the present application;

[0059] Figure 6a A schematic diagram of adjusting the image angle according to the axis in various embodiments of the present application;

[0060] Figure 6b This is a schematic diagram of various embodiments of the present application normalized to the same direction;

[0061] Figure 7a Schematic diagram of identification lines of various embodiments of the present application;

[0062] Figure 7b Schematic diagram of the selection of identification lines for the three types of positions, left, middle and right, in various embodiments of the present application;

[0063] Figure 8a A schematic diagram of a feature vector formed by the intersection of the identification line and the pattern in each embodiment of the present application;

[0064] Figure 8b Schematic diagram of encoding and normalization of feature vectors in various embodiments of the present application. Specific embodiments

[0065] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0066] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present invention, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.

[0067] Embodiment 1

[0068] The embodiment of the present invention provides a method for identifying the identity information of an active target based on surface texture. Figure 1 As shown, the method for identifying the identity information of an active target based on surface texture includes:

[0069] S101, constructing a plurality of first identification lines of the moving target according to a first surface image and first depth data of the moving target collected;

[0070] S102, extracting identity feature information of the moving target according to attribute information of intersections between the plurality of first identification lines and edges of each texture region of the first surface image;

[0071] S103, performing feature matching on the identity feature information of the activity target according to a pre-established identity information feature library, and identifying the identity information of the activity target.

[0072] The activity target may be an artificially raised animal with a surface texture, such as a cow with black and white stripes. The surface image data may be back surface image data of the activity target. The identity information feature library includes multiple activity target identity information, and the identity information may include the activity target's identification and the activity target identity feature information.

[0073] The method provided in the embodiment of the present invention is particularly suitable for identifying dairy cows raised in a farm, and of course can also be used for identifying other animals raised in a farm.

[0074] The method provided by the embodiment of the present invention constructs multiple first identification lines of the active target based on the collected first surface image and first depth data of the active target; and extracts the identity feature information of the active target based on the attribute information of the intersection points of the multiple first identification lines and the edges of each texture area of ​​the first surface image; thereby, according to the pre-established identity information feature library, feature matching is performed on the identity feature information of the active target to identify the identity information of the active target, thereby realizing a non-invasive identity recognition based on vision, and effectively solving the problem that algorithms such as LBP feature extraction, SURF feature extraction, HU distance contour similarity are easily interfered by various factors such as shooting angle, lighting, fur pollution, etc. in the case of complex production environment of ranches, effectively solving the instability problem of the above algorithms, and realizing high-accuracy identity recognition of active targets.

[0075] In some embodiments, constructing a plurality of first identification lines of the moving target according to the collected first surface image and first depth data of the moving target may include:

[0076] Collecting a first surface image and first depth data of a moving target below the collecting device according to an image and depth data collecting device pre-set above the identification channel;

[0077] In the effective recognition area of ​​the first surface image, determining the center line of the moving object according to the first depth data, and constructing a plurality of elliptical lines on both sides of the center line of the moving object respectively;

[0078] The center line of the moving object and the elliptical lines on both sides of the center line are used as a plurality of first identification lines of the moving object.

[0079] Among them, multiple means between 3 and 13 items.

[0080] The embodiment of the present invention determines the center line of the active target in the surface image based on the depth data, and can efficiently and accurately determine the identification line. By setting the effective identification area and the center line and the elliptical lines on both sides, it can accurately and comprehensively reflect the identity feature information of the active target, thereby further improving the recognition accuracy.

[0081] In some embodiments, extracting the identity feature information of the moving target according to the attribute information of the intersections between the plurality of first identification lines and the edges of each texture region of the first surface image may include:

[0082] Determine, according to the two end points of each first identification line, the intersection attribute information of each first identification line and each texture area of ​​the first surface image; the attribute information of any intersection includes the position information of the intersection and the color transformation information of the intersection;

[0083] Constructing a feature vector of each first identification line according to the attribute information of each intersection point of each first identification line;

[0084] Constructing a first eigenvector matrix of the moving target according to the eigenvectors of the plurality of first identification lines;

[0085] The first feature vector matrix of the activity target is used as the identity feature information of the activity target.

[0086] The embodiment of the present invention constructs the identity feature information of the moving target based on the attribute information of the intersections of multiple identification lines and the identification lines and each texture area. Not only is the algorithm fast and effectively improves the recognition speed, but it can also fully reflect the identity features of the moving target and avoid the problem of recognition errors. It further effectively solves the problem that algorithms such as LBP feature extraction, SURF feature extraction, and HU distance contour similarity are easily interfered by various factors such as shooting angle, lighting, and fur pollution in the complex production environment of the ranch, effectively solves the instability problem of the above algorithms, and can achieve high-accuracy identity recognition of moving targets.

[0087] In some embodiments, performing feature matching on the identity feature information of the activity target according to a pre-established identity information feature library to identify the identity information of the activity target may include:

[0088] Determining the station type corresponding to the first eigenvector matrix according to the positional relationship between the center line of the moving target and the center line of the first surface image in the same direction;

[0089] Determine from the identity information feature database each identity identification feature matrix of the same station type as the first feature vector matrix;

[0090] The identity information of the activity target is identified based on the similarity between the first feature vector matrix and each identity identification feature matrix of the same station type.

[0091] In the specific implementation process, the above-mentioned embodiments can be arbitrarily combined to obtain a specific embodiment, thereby further improving the recognition accuracy. Taking a cow as an example, a specific embodiment is provided based on the combination of the above-mentioned embodiments. In this embodiment, for the sake of distinction, the image and depth data acquisition device used to generate the identity information of the active target is referred to as an image and depth data acquisition device, and the image and depth data acquisition device used to identify the identity information of the active target is referred to as an image and depth data second acquisition device. The recognition line when identifying a cow is referred to as the first recognition line, and the recognition line when establishing an identity information feature library is referred to as the second recognition line. For the same reason, the terms such as surface image data and depth data are distinguished by the first and second. The active target refers to the cow to be identified, and the active sample refers to the cow for constructing the identity information feature library.

[0092] In order to improve the applicability and reliability of cow identification, this embodiment sets an identification scenario including a narrow identification channel for cows in transit, and designs an empirical feature statistical algorithm based on the identification channel to achieve high anti-interference and high-precision cow identification in this scenario. The identification scenario meets the following preset applicable rules:

[0093] 1) Identification channel: refers to the road that the cow needs to walk through when being identified. The width and length are respectively the preset width and preset length. The preset width can be set between 4 and 6 meters, and the preset length can be determined according to actual needs, usually greater than 6 meters.

[0094] 2) Image and depth data acquisition device: The image and depth data acquisition device is used to acquire the color image and depth information of the target to be identified. The depth data includes the distance data between the acquisition device and the target to be identified, which can be converted into the horizontal distance and the vertical height information. In this embodiment, the acquisition device is composed of a color camera and a depth camera group.

[0095] like Figure 2a As shown, the color camera and depth camera group uses two cameras, one is an ordinary color camera C1, which is used to take color pictures under appropriate light intensity; the other is a depth camera C2, which is used to obtain the distance data between the camera and the photographed object, and the data can be converted into horizontal distance and vertical height information.

[0096] 3) Color image and depth information acquisition time: The shooting of C1 and C2 is highly synchronized in time, that is, the time deviation between each frame of image acquired by C1 and each frame of depth data acquired by C2 is kept within 0.1 second.

[0097] 4) Collection device deployment position: C1 and C2 are deployed at a preset height above the identification channel to ensure the same deployment height and shooting angle. For example, at a height of about 3.8 meters to 4.2 meters above the identification channel. C1 and C2. The horizontal distance between C1 and C2 is no greater than the preset width to ensure that the two cameras have almost the same shooting angle. For example, less than 10 centimeters.

[0098] 5) Valid image samples: trigger the color camera and the depth camera to perform synchronous acquisition, so that the color camera acquires the first surface image and the depth camera acquires the first depth data; determine the highest point positions at both ends of the active target according to the first depth data; determine the center line of the active target according to the highest point positions at both ends of the active target; determine whether the first surface image is a valid image according to the horizontal relative distance between the center line of the active target and the center line of the first surface image in the same direction.

[0099] like Figure 7b As shown in the figure, the camera mainly captures the fur image of the cow's back from a bird's-eye view; ideally, the cow is completely located directly below the camera. Considering the actual walking situation of the cow, the cow's spine position is allowed to deviate from the center of the picture; as long as the deviation of the cow's position from the vertical position of the camera is within a certain threshold range, the image is valid.

[0100] Based on the above recognition scenario, the workflow of this embodiment is divided into three parts; the first part constructs feature extraction based on the fur texture of the cow, and the feature extraction is used in the early stage of establishing the cow identity and the later stage of comparing the cow identity; the second part describes the construction of a cow identity feature library based on texture feature vectors; the third part describes a feature matching algorithm that can realize the recognition of the cow identity.

[0101] Part 1: Extraction of fur texture features at the identified location (back)

[0102] According to the collected first surface image and first depth data of the moving target, multiple first identification lines of the moving target are constructed; according to the intersection attribute information of the multiple first identification lines and the edges of each texture area of ​​the first surface image, the identity feature information of the moving target is extracted. This may include:

[0103] 1) Extraction of effective recognition area

[0104] The effective recognition area refers to the effective area used for feature extraction and identity comparison. It roughly includes the fur image of the cow's back and both sides of the back. The reason for extracting the effective recognition area is that the background ground is easily confused with the cow's fur image, such as Figure 3a Another problem is that when multiple cows walk side by side, their body images may overlap in the shot, as shown in Figure 3b To accurately obtain the effective identification area, this embodiment adopts two processing methods:

[0105] a. Figure 3a As shown in FIG. 1 , when a cow passes under the camera, based on the image captured by camera C1, the object detection technology (Objects Detection) of the convolutional neural network CNN is used to obtain the identification box BBX (bounding box) of each cow. The rectangular box defines the approximate position of the cow under the camera, as shown in FIG. Figure 4 As shown. In combination with Article 5 of the applicable rules, invalid BBX can be removed to obtain the sample S1 that is qualified for the preliminary selection;

[0106] b. Based on the data captured by the depth camera C2, the three-dimensional data of the cow's body is obtained, combined with the surface image data of C1, so as to obtain the effective recognition area. For specific methods, please refer to point (2).

[0107] 2) Extraction of key points on the cow’s back

[0108] like Figure 5 As shown, the depth camera data obtained by the C2 camera is height, which is not affected by lighting conditions and background colors. When shooting the cow's back, it contains the ups and downs of the cow's back. Based on the picture range determined by S1, the depth data shot by C2 is extracted synchronously; among them, the positions of the cow's coccyx E and shoulder blade F are at a relatively high position, which are shown as local peaks in the data and constitute two endpoints. Therefore, the positions of E and F can be obtained through the depth data; and based on the key points (endpoints) of E and F, the cow's spine line J is determined by searching, which is roughly the line from E to F. At the same time, E and F also determine the direction from the cow's tail to its head.

[0109] 3) Image correction

[0110] like Figure 6a As shown, based on the spine line and head-tail direction of a single cow, the spine line can be rotated from the tail to the head to be vertically downward, where the vertical direction is the downward direction as shown in the figure. Correction method: if the angle between the spine line J and the vertical direction is θ degrees, the local image in the BBX is rotated clockwise by θ degrees. The corrected S1 image forms sample S2;

[0111] 4) Cow location classification

[0112] like Figure 6bAs shown, according to the applicable scenario No. 3, the actual standing position of the cow may be in the middle, to the left or to the right relative to the cameras C1 and C2. To ensure the validity of the picture, this embodiment defines the maximum deviation of the cow's J line to the left or to the right, expressed as the distance DJ of the J line relative to the center line of the picture, which is defined as a threshold. When it is biased to the left, it is expressed by a negative value, and when it is biased to the right, it is expressed by a positive value. At the midline position, DJ is 0. According to this definition, sample S2 can be classified into three types, namely, the spine line is centered (L0 type), the spine line is biased to the left (L-type), and the spine line is biased to the right (L type). When the threshold DJ is set, the cow samples that exceed the DJ range in the S2 sample can be eliminated, thereby obtaining the sample S3 that can be used for identity recognition.

[0113] 5) Determination of identification line

[0114] like Figure 7a As shown, in the effective recognition area of ​​the first surface image, the center line of the moving target is determined according to the first depth data, and a plurality of elliptical lines are constructed on both sides of the center line of the moving target; the center line of the moving target and the elliptical lines on both sides of the center line are used as a plurality of first recognition lines of the moving target.

[0115] For example, take the spine line J of sample S3 as the center line, construct M ellipses, and the major axis of the ellipse is the spine line J. The length of the minor axis is a non-equally spaced sequence, specifically defined as L{L0, L1..Lm}. With the spine line as the center line, the ellipse is divided into a half ellipse line on the left (hereinafter referred to as the EL line) and a half ellipse line on the right (hereinafter referred to as the ER line), thereby determining a total of 2*M1 identification lines, among which L0 is the J line. Figure 7b As shown in the figure, according to the type feature T of S3, it can be divided into three relative position standing types: T0 (relative to the middle position), T (relative to the right position), and T- (relative to the left position), and elliptical lines are constructed respectively. Among them, T-type mainly uses ER line, T type mainly uses EL line, and T0 type uses EL and ER lines as identification lines at the same time; the relative position is the position of the cow relative to the camera.

[0116] 6) Construction of eigenvector matrix

[0117] According to the two end points of each first identification line, the intersection attribute information of each first identification line and each texture area of ​​the first surface image is determined; the attribute information of any intersection includes the position information of the intersection and the color transformation information of the intersection; according to the attribute information of each intersection of each first identification line, the feature vector of each first identification line is constructed; according to the feature vectors of multiple first identification lines, the first feature vector matrix of the active target is constructed; and the first feature vector matrix of the active target is used as the identity feature information of the active target.

[0118] like Figure 8a As shown, the texture (pattern) on the back of a cow is usually composed of black and white. More generally, it is defined as dark and light patch areas. An identification line will pass through the pattern area and form an intersection with the edge of the patch. In order to record the intersection attribute information, the following encoding method is used:

[0119] a. Location information of the intersection: Figure 8a As shown, the identification line at the tail is taken as the starting point, and the identification line near the shoulder blade is taken as the end point; walking along the ellipse line, the color of the fur is detected point by point, and when a sudden change in light or dark color occurs, an intersection is generated;

[0120] b. The intersection contains two attribute information. One is the relative position P of the intersection, which defines the ratio of the distance from the starting point to this point to the length of the entire ellipse. The other is the color change feature at this position. If it is from light color to dark color, it is defined as 0, otherwise it is defined as 1. The information of an intersection is recorded as a two-dimensional vector, recorded as (P,0) or (P,1).

[0121] c. Feature vector construction: determine the position information of each intersection of each first identification line based on the relative position of each intersection of the first identification line and the first endpoint of the first identification line; determine the color transformation information of the first identification line passing through each intersection based on the direction from the first endpoint to the second endpoint of each first identification line; construct a two-dimensional vector of each intersection of the first identification line based on the position information and color transformation information of the first identification line to generate a feature vector for each first identification line.

[0122] Specifically, all intersection points of the entire recognition line constitute the feature vector of the recognition line.

[0123] like Figure 7b As shown, the feature vector obtained by identifying the line L-3 (3 represents the serial number of the ellipse line) is:

[0124] L-3: (0,0),(62,1),(73,0),(78,1),(96,0)(1)

[0125] Wherein, the position information 62 represents the percentage of the aforementioned ratio;

[0126] d. Normalized features: To improve the robustness of features during recognition, the position information of formula (1) can be normalized, that is, the position with a distance less than 5% is defined as P0, 5% to 15% is defined as P1, and so on, and the position greater than 95% is defined as P10, with a total of 11 levels; the normalized feature vector obtained is:

[0127] L-3: (P0,0),(P6,1),(P7,0),(P9,1),(P10,0)(2)

[0128] 7) Construction of feature matrix

[0129] Depend on Figure 8b It can be seen that according to the relative position of the camera and the cow, the shooting picture can be divided into three types of positions: T0, T and T-, thereby determining the typical identification line for each situation, namely

[0130] a) T0 center position type: the identification lines are symmetrical, and the effective identification lines are Ln...L-2, L-1, L0, L1, L2...Ln, identification lines; the value of n is generally between 5 and 8; the following case uses n=6 as an example;

[0131] b) T right-biased position type: The effective identification line is mainly on the left side. In the extreme right case, the identification line can be defined as L-1 to L-6, L0, L1, and L2. In actual conditions, the appropriate identification line can be selected according to the degree of right deviation;

[0132] c) T-left-biased stance: The effective identification line is mainly on the right side. In the extreme case of the left, the identification line can be defined as L-2, L-1, L0, L1~L6. In actual conditions, the appropriate identification line can be selected according to the degree of left deviation;

[0133] In this embodiment, the number of identification lines is determined according to the degree of deviation, and is generally between 9 and 13; the number of identification lines selected on the left and right is asymmetric; the purpose is to achieve more effective feature sampling;

[0134] When a cow passes by the camera, multiple identification lines are defined according to its left or right type. According to the construction rules of feature vectors, feature vectors can be extracted for each identification line, and finally a feature matrix M is formed for a specific back image.

[0135] Part 2: Establishment of Identity Information Feature Database

[0136] In the case of an ideal sampling image, images of the center (T0), left (T-), and right (T) of the cow's back are collected to establish the identity characteristics of the cow. Figure 2b As shown in the figure, during the identity establishment stage, three groups of cameras are used to collect comprehensive images of the cow's back and side parts. Each group of cameras contains a C1 and a C2. In the ideal case, when the cow is directly below the "middle" camera, the "left" and "right" camera groups also shoot at the same time, and the collected data includes color images and depth data.

[0137] At this time, the distance between the three camera groups meets Figure 6bThe definition of DJ; the images seen by the three cameras, such as Figure 7b As shown in the figure, the same cow forms images of the center, left and right sides; by extracting features from the three images at the same time, the feature matrices M0, M, M- in the three standing positions of T0, T, and T- can be obtained respectively. This matrix is ​​defined as the identity feature of the cow, and a unique ID can be assigned to the feature, thereby constructing an identity information feature library of all cows (referred to as the feature library).

[0138] Part 3: Identification of the target (cow)

[0139] According to the pre-established identity information feature library, feature matching is performed on the identity feature information of the activity target to identify the identity information of the activity target. This includes:

[0140] According to the positional relationship between the center line of the moving target and the center line of the first surface image in the same direction, the position type corresponding to the first eigenvector matrix is ​​determined; each identity identification feature matrix of the same position type as the first eigenvector matrix is ​​determined from the identity information feature library; and according to the similarity between the first eigenvector matrix and each identity identification feature matrix of the same position type, the identity information of the moving target is identified.

[0141] Specifically, cow identification is the process of collecting real-time images, extracting features, and matching features with the identity information feature library, which is the application stage of the feature library. The specific process of this embodiment is as follows:

[0142] 1) Deployment of acquisition devices: Only one set of cameras is deployed in the identity recognition stage, such as Figure 2a When a cow passes under the camera, its position may be any of the T0, T, and T-station types.

[0143] 2) Extraction of feature matrix: Based on the station type, Figure 8b For the three defined station situations, select a matching identification line and extract its feature matrix M, which can only be one of M0, M, and M-.

[0144] 3) Feature comparison: determine the feature vector differences between the first feature vector matrix and each feature vector of each identification line of each identity identification feature matrix of the same station type; determine the identity identification feature matrix with the smallest matrix difference with the first feature vector matrix in each identity identification feature matrix of the same station type based on the feature vector differences between the first feature vector matrix and each feature vector of each identification line; identify the identity information of the active target based on the identity identification feature matrix with the smallest matrix difference.

[0145] Specifically, the feature matrix M currently extracted in real time, for example, M0, is compared with all the M0-type features in the identity information feature library, and the identity of the cow is determined by the feature library features with the highest similarity. The specific comparison process includes:

[0146] a. Correction of identification line:

[0147] Before determining the eigenvector difference between the first eigenvector matrix and each eigenvector of each identification line of each identity identification feature matrix of the same station type, correcting each identification line of the first eigenvector matrix by interpolation;

[0148] like Figure 6b As shown, the features in the feature library contain the feature information of the cow being at the far left and the far right, while the actual position of the cow is between the far left and the far right, that is, the actual DJ is smaller than the maximum DJ. Since the same physical position has the same feature vector, the interpolation method is used in this embodiment to obtain the corrected ellipse line. Since T or T- represents the maximum deviation to the left or right, and T0 represents the center, the ellipse line of T and T0 (or the ellipse line of T- and T0) is interpolated based on the degree of deviation; assuming that the points on the sampling line are all K points, and the coordinates of each sampling point are (x, y), then the correction method for the L recognition line is:

[0149] According to the horizontal relative distance between the center line of the moving target and the center line of the first surface image in the same direction and the preset maximum distance, the deviation factor γ is determined, the preset sampling point coordinates of each recognition line are interpolated according to the deviation factor γ, and each recognition line is corrected according to the interpolation.

[0150]

[0151] X L修正,T修正,i =γ*X L,T,i +(1-γ)*X L,T0,i i=1,k(4a)

[0152] Y L修正,T修正,i =γ*Y L,T,i +(1-γ)*Y L,T0,i i=1,k(4b)

[0153] Formula (3) calculates the deviation factor γ, which expresses the degree of deviation between the position of the cow and the position when the feature library is sampled. Formulas (4a) and (4b) interpolate and correct the L1 recognition lines of T and T0 based on the deviation factor γ.

[0154] b. Calculation of similarity of features of equal length: Taking the T0 type as an example, the identification lines are Ln...L-2, L-1, L0, L1, L2...Ln. In order to calculate the similarity between the feature matrix A to be identified and the feature matrix of the feature library B, this embodiment adopts the following weighted distance calculation. Taking the feature vector of L as an example, according to (7) of Part 1, its feature vector is:

[0155] (P 0~10 , C) i ,i=1,m;C=1|0; (5a)

[0156] Among them, P is the normalized position information, C is the color change information, which can only be 0 or 1;

[0157] Assume that each row of feature vectors of A and B (i.e., feature vectors of each identification line) are of equal length, and assume that there are m of them. Since the importance of color change is higher than the position information of feature intersection, a weighted value Q is used for color, and its value is between 10 and 100. Then the difference D between the two feature vectors of A and B corresponding to Li is Li for:

[0158]

[0159] The overall matrix difference of the M matrix is ​​D:

[0160]

[0161] c. Similarity calculation of features of non-equal lengths: Still taking the T0 type as an example, if the feature matrix A of the real-time sampling and the feature matrix B of the feature library have unequal numbers of intersections of a certain recognition line, in order to realize the calculation of non-equal lengths, this embodiment uses the following method to calculate the difference:

[0162]

[0163] Among them, P B->close is with P A The intersection with the shortest distance; C B,close is the color transformation information of the intersection. The nearest point always exists, and the calculation of formula (7) can obtain the appropriate difference.

[0164] 4) Identity recognition: If the difference is greater than the maximum allowed difference Dmax, it is considered that the cow sampled in real time does not have a corresponding relationship with the current cow identity in the feature library. The M matrix of the entire feature library is compared, and the ID of the M matrix with the lowest difference is the identity ID of the cow.

[0165] Embodiment 2

[0166] An embodiment of the present invention provides a method for generating identity information of an active target based on surface texture, the method comprising:

[0167] constructing a plurality of second identification lines of the active sample according to the collected second surface image and second depth data of the active sample;

[0168] Extracting identity feature information of the activity sample according to attribute information of intersections between the plurality of second identification lines and edges of each texture region of the second surface image;

[0169] An identity information feature library of multiple activity samples is constructed according to the identity feature information of multiple activity samples.

[0170] Embodiment 3

[0171] An embodiment of the present invention provides an electronic device, the electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor;

[0172] When the computer program is executed by the processor, the steps of the method for identifying the identity information of an active target based on surface texture as described in any one of the first embodiment or the steps of the method for generating the identity information of an active target based on surface texture as described in the second embodiment are implemented.

[0173] Embodiment 4

[0174] An embodiment of the present invention provides a computer-readable storage medium, on which is stored a program for identifying identity information of an active target based on surface texture and / or a program for generating identity information of an active target based on surface texture;

[0175] When the surface texture-based active target identity information recognition program is executed by the processor, the steps of the surface texture-based active target identity information recognition method according to any one of the first embodiments are implemented;

[0176] When the program for generating the identity information of an active target based on surface texture is executed by a processor, the steps of the method for generating the identity information of an active target based on surface texture as described in the second embodiment are implemented.

[0177] The specific implementation of Embodiments 2 to 4 may refer to Embodiment 1, and have corresponding technical effects.

[0178] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0179] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0180] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better embodiment. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0181] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific embodiments. The above-mentioned specific embodiments are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.

Claims

1. A method for identifying the identity information of an active target based on surface texture, characterized in that: The method for identifying the identity information of an active target based on surface texture comprises: Constructing a plurality of first identification lines of the moving target according to the collected first surface image and first depth data of the moving target; Extracting the identity feature information of the active target according to the attribute information of the intersections of the plurality of first identification lines and the edges of the respective texture regions of the first surface image; comprising: determining the attribute information of the intersections of each first identification line and the respective texture regions of the first surface image according to the two end points of each first identification line; the attribute information of any intersection includes the position information of the intersection and the color transformation information of the intersection; constructing the feature vector of each first identification line according to the attribute information of each intersection of each first identification line; constructing the first feature vector matrix of the active target according to the feature vectors of the plurality of first identification lines; and using the first feature vector matrix of the active target as the identity feature information of the active target; According to a pre-established identity information feature library, feature matching is performed on the identity feature information of the activity target to identify the identity information of the activity target.

2. The method for identifying the identity information of an active target based on surface texture according to claim 1, characterized in that: The step of constructing a plurality of first identification lines of the moving target according to the collected first surface image and first depth data of the moving target comprises: Collecting a first surface image and first depth data of a moving target below the collecting device according to an image and depth data collecting device pre-set above the identification channel; In the effective recognition area of ​​the first surface image, determining the center line of the moving object according to the first depth data, and constructing a plurality of elliptical lines on both sides of the center line of the moving object respectively; The center line of the moving object and the elliptical lines on both sides of the center line are used as a plurality of first identification lines of the moving object.

3. The method for identifying the identity information of an active target based on surface texture according to claim 2 is characterized in that: The acquisition device includes a color camera and a depth camera; the horizontal distance between the color camera and the depth camera is no greater than a preset width, and the deployment heights are the same; The collecting of the first surface image and the first depth data of the moving target below the collecting device according to the image and depth data collecting device pre-set above the identification channel comprises: Triggering the color camera and the depth camera to perform synchronous acquisition, so that the color camera acquires the first surface image, and the depth camera acquires the first depth data; Determine the highest point positions at both ends of the moving target according to the first depth data; Determine the center line of the moving target according to the highest point positions at both ends of the moving target; determining whether the first surface image is a valid image according to a horizontal relative distance between a center line of the moving target and a center line of the first surface image in the same direction; When it is determined that the image is a valid image, a valid identification area of ​​the first surface image is determined according to the first surface image and / or the first depth data.

4. The method for identifying the identity information of an active target based on surface texture according to claim 1, characterized in that: The step of constructing a feature vector of each first identification line according to the attribute information of each intersection of each first identification line includes: Determine the position information of each intersection point of each first identification line according to the relative position between each intersection point of each first identification line and the first end point of the first identification line; According to the direction from the first end point to the second end point of each first identification line, determine the color transformation information of each intersection point where the first identification line passes through; According to the position information and color transformation information of each intersection of the first identification line, a two-dimensional vector of each intersection of the first identification line is constructed to generate a feature vector of each first identification line.

5. The method for identifying the identity information of an active target based on surface texture according to claim 3 is characterized in that: The performing feature matching on the identity feature information of the activity target according to the pre-established identity information feature library to identify the identity information of the activity target includes: Determining the station type corresponding to the first eigenvector matrix according to the positional relationship between the center line of the moving target and the center line of the first surface image in the same direction; Determine from the identity information feature database each identity identification feature matrix of the same station type as the first feature vector matrix; The identity information of the activity target is identified based on the similarity between the first feature vector matrix and each identity identification feature matrix of the same station type.

6. The method for identifying the identity information of a moving target based on surface texture according to claim 5, characterized in that: The station type includes a middle station type, a relatively left station type and a relatively right station type; The identifying the identity information of the activity target according to the similarity between the first feature vector matrix and each identity identification feature matrix of the same station type includes: Determine the eigenvector difference between each eigenvector of each identification line of each identity identification feature matrix of the same station type and the first eigenvector matrix; According to the feature vector differences of each feature vector of each identification line, in each identity feature matrix of the same station type, determining the identity feature matrix having the smallest matrix difference with the first feature vector matrix; The identity information of the activity target is identified according to the identity identification feature matrix with the smallest matrix difference.

7. An electronic device, characterized in that: The electronic device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor; When the computer program is executed by the processor, the steps of the method for identifying identity information of an active target based on surface texture as claimed in any one of claims 1 to 6 are implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program for identifying the identity information of an active target based on surface texture and / or a program for generating the identity information of an active target based on surface texture; When the surface texture-based moving target identity information recognition program is executed by a processor, the steps of the surface texture-based moving target identity information recognition method as claimed in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Face recognition method of combining depth information, device and storage medium

    CN107844744A

  • Image recognition method and device, computer equipment and storage medium

    CN113033459A