Tibetan sheep individual and body size information recognition method and device
By combining image analysis and point cloud processing technology with hair density and brightness analysis, the PointNet network is used to calculate the point cloud data of the Tibetan sheep carcass, which solves the problems of low efficiency and poor safety of traditional manual measurement and realizes non-contact and accurate body size measurement.
Patent Information
- Application Number
- CN202411790085.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2044-12-06
AI Technical Summary
Traditional Tibetan sheep body measurements rely on manual methods, which are inefficient, prone to causing stress, and the results are subjective, posing a risk of disease transmission.
By combining image analysis and point cloud processing techniques with hair density and brightness analysis, the PointNet network was used to calculate the carcass point cloud data of Tibetan sheep and determine their body size information.
It enables non-contact, precise measurement of Tibetan sheep body size, improving measurement efficiency, reducing the risk of stress response, and ensuring measurement safety and accuracy.
Smart Images

Figure CN119919472B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and particularly relates to a Tibetan sheep individual and body size information identification method and device. BACKGROUND
[0002] Traditional Tibetan sheep feeding and management methods have many problems, such as low feeding efficiency, inaccurate body condition evaluation, and the like, and are difficult to meet the comprehensive monitoring and evaluation needs of large-scale farms for Tibetan sheep, and are easily affected by subjective factors.
[0003] In the related art, Tibetan sheep body size and weight measurement mainly relies on manual measurement methods, which have the following problems: due to the large size and strong wildness of Tibetan sheep, multiple adults need to cooperate with each other to measure the weight and body size, which consumes time and energy, and the measurement efficiency is low and the results are subjective; in the measurement process, long-term direct contact with people can easily cause stress reaction of Tibetan sheep, affecting its growth and development, and in serious cases, it can even lead to serious illness and even death; the contact measurement increases the risk of disease transmission and parasite transmission between humans and animals.
[0004] Therefore, how to more effectively measure the body size of Tibetan sheep has become a problem to be solved in the industry. SUMMARY
[0005] The present application provides a Tibetan sheep individual and body size information identification method and device to solve the problem of how to more effectively measure the body size of Tibetan sheep in the prior art.
[0006] The present application provides a Tibetan sheep individual and body size information identification method, comprising the following steps:
[0007] Performing hair shadow area analysis on a first image of a Tibetan sheep to be measured to determine the first hair density of the Tibetan sheep to be measured;
[0008] According to the brightness values of each pixel region in the first image, the second hair density of the Tibetan sheep to be measured is estimated;
[0009] According to the first hair density and the second hair density, the hair thickness of the Tibetan sheep to be measured and the individual information of the Tibetan sheep to be measured are determined;
[0010] According to the hair thickness of the Tibetan sheep to be measured, the overall point cloud data of the Tibetan sheep to be measured is segmented to determine the carcass point cloud data of the Tibetan sheep to be measured;
[0011] According to the carcass point cloud data of the Tibetan sheep to be measured, the carcass body size information of the Tibetan sheep to be measured is determined.
[0012] According to the application, a Tibetan sheep individual and body size information recognition method is provided, which comprises the following steps:
[0013] According to the product of the first hair density and a first preset weight coefficient, and the product of the second hair density and a second preset weight coefficient, a third hair density information of the Tibetan sheep to be measured is determined.
[0014] According to the hair-bearing body size information and the third hair density information of the Tibetan sheep to be measured, a hair thickness of the Tibetan sheep to be measured is determined.
[0015] According to the hair-bearing body size information and the hair thickness of the Tibetan sheep to be measured, individual information of the Tibetan sheep to be measured is determined.
[0016] According to the application, a Tibetan sheep individual and body size information recognition method is provided, which comprises the following steps:
[0017] After image preprocessing, the Tibetan sheep image area in the first image is recognized by an edge detection algorithm.
[0018] The Tibetan sheep hair shadow area in the Tibetan sheep image area is determined according to the gray value change information of each pixel point in the Tibetan sheep image area.
[0019] According to the ratio between the area of each Tibetan sheep hair shadow area and the area of the Tibetan sheep image area, the first hair density of the Tibetan sheep to be measured is determined.
[0020] According to the application, a Tibetan sheep individual and body size information recognition method is provided, which comprises the following steps:
[0021] The first image is analyzed by a local brightness analysis method to determine the brightness value of each pixel area in the first image.
[0022] The pixel area with a brightness value greater than a first preset threshold value is regarded as a high-density hair area, and the pixel area with a brightness value lower than a second preset threshold value is regarded as a low-density hair area.
[0023] According to the ratio between the brightness value of the low-density hair area and the brightness value of the high-density hair area, the second hair density of the Tibetan sheep to be measured is determined.
[0024] According to the application, a Tibetan sheep individual and body size information recognition method is provided, which comprises the following steps:
[0025] The carcass point cloud data of the to-be-tested Tibetan sheep is input into a PointNet network, and key points of the carcass of the to-be-tested Tibetan sheep are output.
[0026] The carcass body size information of the to-be-tested Tibetan sheep is calculated based on the Euclidean distances between the key points of the carcass of the to-be-tested Tibetan sheep.
[0027] According to the application, a Tibetan sheep individual and body size information recognition method is provided, which comprises the following steps:
[0028] A plurality of point cloud sample information carrying key point labels is obtained.
[0029] Each point cloud sample information is sent to a preset PointNet network, and a predicted key point corresponding to the point cloud sample information is output.
[0030] A loss value is calculated based on the predicted key point and the key point label, and the training is stopped when the loss value is lower than a third preset threshold value, and the PointNet network is obtained.
[0031] The application further provides a Tibetan sheep individual and body size information recognition device, which comprises the following modules:
[0032] An analysis module is configured to analyze the hair shadow area of a first image of a to-be-tested Tibetan sheep, and determine the first hair density of the to-be-tested Tibetan sheep.
[0033] A prediction module is configured to predict the second hair density of the to-be-tested Tibetan sheep according to the brightness values of each pixel region in the first image.
[0034] A determination module is configured to determine the hair thickness of the to-be-tested Tibetan sheep and the individual information of the to-be-tested Tibetan sheep according to the first hair density and the second hair density.
[0035] A segmentation module is configured to segment the overall point cloud data of the to-be-tested Tibetan sheep according to the hair thickness of the to-be-tested Tibetan sheep, and determine the carcass point cloud data of the to-be-tested Tibetan sheep.
[0036] A recognition module is configured to determine the carcass body size information of the to-be-tested Tibetan sheep according to the carcass point cloud data of the to-be-tested Tibetan sheep.
[0037] The device for identifying individual and body size information of Tibetan sheep provided by the application is also used for:
[0038] The third hair density information of the to-be-tested Tibetan sheep is determined according to the sum of the product of the first hair density and the first preset weight coefficient and the product of the second hair density and the second preset weight coefficient.
[0039] The hair thickness of the to-be-tested Tibetan sheep is determined according to the hair-covered body size information and the third hair density information of the to-be-tested Tibetan sheep.
[0040] The individual information of the to-be-tested Tibetan sheep is determined according to the hair-covered body size information and the hair thickness of the to-be-tested Tibetan sheep.
[0041] The device for identifying individual and body size information of Tibetan sheep provided by the application is also used for:
[0042] After image preprocessing of the first image, the Tibetan sheep image area in the first image is identified through an edge detection algorithm.
[0043] The Tibetan sheep hair shadow area in the Tibetan sheep image area is determined through the gray value change information of each pixel point in the Tibetan sheep image area.
[0044] The first hair density of the to-be-tested Tibetan sheep is determined according to the ratio between the area of each Tibetan sheep hair shadow area and the area of the Tibetan sheep image area.
[0045] The device for identifying individual and body size information of Tibetan sheep provided by the application is also used for:
[0046] The brightness value of each pixel area in the first image is determined through local brightness analysis of the first image.
[0047] The pixel area with a brightness value greater than a first preset threshold value is taken as a high-density hair area, and the pixel area with a brightness value lower than a second preset threshold value is taken as a low-density hair area.
[0048] The second hair density of the to-be-tested Tibetan sheep is determined according to the ratio between the brightness value of the low-density hair area and the brightness value of the high-density hair area.
[0049] The device for identifying individual and body size information of Tibetan sheep provided by the application is also used for:
[0050] The carcass point cloud data of the to-be-tested Tibetan sheep is input into a PointNet network, and the key points of the carcass of the to-be-tested Tibetan sheep are output; the key points include at least one of the following: head key points, chest key points and limb key points.
[0051] Calculate the carcass size information of the to-be-tested Tibetan sheep based on the Euclidean distance between the key points of the to-be-tested Tibetan sheep carcass.
[0052] According to the present application, a Tibetan sheep individual and size information recognition device is provided, and the device is also used for:
[0053] Obtain a plurality of point cloud sample information carrying key point labels;
[0054] Send each point cloud sample information to a preset PointNet network, and output the predicted key points corresponding to the point cloud sample information.
[0055] Based on the predicted key points and the key point labels, calculate a loss value, and stop training if the loss value is lower than a third preset threshold value, to obtain the PointNet network.
[0056] The present application also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to realize the Tibetan sheep individual and size information recognition method as described above.
[0057] The present application also provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executable by a processor to realize the Tibetan sheep individual and size information recognition method as described above.
[0058] The present application also provides a computer program product including a computer program, wherein the computer program is executable by a processor to realize the Tibetan sheep individual and size information recognition method as described above.
[0059] The present application provides a Tibetan sheep individual and size information recognition method and device, because the area with higher hair density usually blocks more light and forms deeper shadows, therefore, the hair density can be estimated by analyzing the area and depth information of the shadow area to determine the first hair density, the local brightness analysis method such as local weighted average or filtering can be used to calculate the light intensity of each area, so as to infer that the area with weak light may be the place with dense hair, and the second hair density is determined, the hair thickness and individual information of the Tibetan sheep are determined by combining the first hair density and the second hair density, the point cloud of the carcass without hair is obtained by subtracting the point cloud of the hair area according to the hair thickness of the to-be-tested Tibetan sheep, so as to accurately calculate the volume of the Tibetan sheep, and the body weight is calculated on this basis, and the measurement of the carcass size information of the to-be-tested Tibetan sheep is completed, and the accuracy and safety of the measurement are effectively ensured. BRIEF DESCRIPTION OF DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0061] Figure 1 is the flowchart of the method for identifying individual and body size information of Tibetan sheep provided by the present application.
[0062] Figure 2 is the structural schematic diagram of the device for identifying individual and body size information of Tibetan sheep provided by the present application.
[0063] Figure 3 is the structural schematic diagram of the electronic device provided by the present application. DETAILED DESCRIPTION
[0064] In order to make the objects, technical solutions and advantages of the present application clearer, the following will combine the drawings in the present application to clearly and completely describe the technical solutions in the present application. Obviously, the described embodiments are some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort belong to the protection scope of the present application.
[0065] Figure 1 is the flowchart of the method for identifying individual and body size information of Tibetan sheep provided by the present application, as shown in Figure 1 , the method comprises the following steps:
[0066] Step 110: analyzing the hair shadow area of the first image of the Tibetan sheep to be measured to determine the first hair density of the Tibetan sheep to be measured.
[0067] In the present application, first, the image is denoised to remove background noise and other irrelevant interference. This can be realized by Gaussian blur or median filtering to smooth the image and reduce noise.
[0068] The area where the shadow may exist is detected by analyzing the change of the gray value of the image. The shadow area is usually caused by the blockage or uneven reflection of the hair, which can be extracted by threshold segmentation.
[0069] The distribution of the detected shadow area is analyzed. If the shadow is deep and concentrated, it may indicate that the area has dense hair. The density of the hair can be estimated by counting the area and depth of the shadow area.
[0070] Using the shadow analysis method, the following steps can be taken: image preprocessing, edge detection, shadow detection, and shadow area analysis. These steps help determine areas with higher hair density, which typically block more light and create deeper shadows.
[0071] Finally, the first hair density of the Tibetan sheep is determined through hair shadow area analysis.
[0072] Step 120, according to the brightness value of each pixel area in the first image, the second hair density of the Tibetan sheep to be tested is estimated;
[0073] In this invention, first, the brightness of the first image of the Tibetan sheep to be tested needs to be analyzed. This can be achieved by calculating the brightness value of each pixel area in the image. The brightness value reflects the reflection of light by hair, and areas with higher hair density usually have lower brightness because more light is absorbed by the hair.
[0074] Local brightness analysis methods such as local weighted average or filtering are used to calculate the light intensity of each area. These intensity values can help infer which areas may be hair-dense, as hair-dense areas typically have lower brightness values.
[0075] To the comprehensive analysis of the brightness value of each pixel area in the image, and the relationship between these brightness values and hair density is modeled and calculated, and the second hair density of the Tibetan sheep is predicted.
[0076] Step 130, according to the first hair density and the second hair density, the hair thickness of the Tibetan sheep to be tested and the individual information of the Tibetan sheep to be tested are determined;
[0077] In this invention, the determination of individual information may include the breed, age, gender and other characteristics of the Tibetan sheep. These information can be inferred by analyzing the specific characteristics of the hair, such as the color, texture and distribution pattern of the hair. For example, different breeds of Tibetan sheep may have different hair characteristics, which can be identified through image analysis techniques.
[0078] In this invention, according to the first hair density (obtained by shadow area analysis) and the second hair density (obtained by brightness value analysis), a relationship model can be established to determine the hair thickness.
[0079] Step 140, according to the hair thickness of the Tibetan sheep to be tested, the overall point cloud data of the Tibetan sheep to be tested is segmented to determine the carcass point cloud data of the Tibetan sheep to be tested;
[0080] In the present application, in order to accurately calculate the carcass point cloud, the hair region must be separated from the point cloud data. The point cloud data without hair is usually generated by three-dimensional reconstruction technology combined with the hair thickness of the measured Tibetan sheep. The distance-based point cloud segmentation technology is used to complete this process. The carcass point cloud is determined by subtracting the hair thickness from the position of the Tibetan sheep hair normal vector, and the carcass point cloud data of the measured Tibetan sheep is obtained.
[0081] In step 150, the carcass size information of the measured Tibetan sheep is determined according to the carcass point cloud data of the measured Tibetan sheep.
[0082] Optionally, the carcass point cloud data of the measured Tibetan sheep is input into the PointNet network, and the key points of the carcass of the measured Tibetan sheep are output. The key points include at least one of the following: head key points, chest key points and limb key points.
[0083] Based on the Euclidean distance between the key points of the carcass of the measured Tibetan sheep, the carcass size information of the measured Tibetan sheep is calculated.
[0084] In the present application, the carcass point cloud data of the measured Tibetan sheep is input into the PointNet network. PointNet is a deep learning network that can directly process point cloud data. It can extract global features from unordered point clouds and output key point information.
[0085] The PointNet network outputs the key points of the Tibetan sheep carcass, including head key points, chest key points and limb key points. These key points are obtained by feature extraction and learning of point cloud data, and can represent the main feature parts of the Tibetan sheep carcass.
[0086] Based on the above key points, the Euclidean distance between them is calculated. Euclidean distance is the most commonly used distance measurement method, which calculates the straight-line distance between two points.
[0087] Using the Euclidean distance between the key points, the carcass size information of the measured Tibetan sheep, such as body length, body height, body width, etc. For example, the body length can be estimated by calculating the distance between the head key points and the chest key points; the body width and body height can be estimated by the distance between the limb key points, and finally the carcass size information of the measured Tibetan sheep is obtained.
[0088] More specifically, the volume of the measured Tibetan sheep can be calculated by voxelizing the point cloud or applying a volume estimation formula. The volume of the sheep is used to estimate the weight, assuming the density of the sheep is known. The commonly used formula is:
[0089]
[0090] wherein, is the volume of the measured Tibetan sheep, is the preset density of the Tibetan sheep.
[0091] In the present application, the analysis of the shadow area can estimate the hair density by counting the area and depth information of the shadow area, because the area with higher hair density usually blocks more light and forms a deeper shadow, to determine the first hair density; through the local brightness analysis method, such as local weighted average or filtering, the light intensity of each area can be calculated, so as to infer that the area with weaker light may be the place where the hair is dense, to determine the second hair density; combining the first hair density and the second hair density, the hair thickness of the Tibetan sheep and the individual information can be determined, according to the hair thickness of the to-be-measured Tibetan sheep, the point cloud of the carcass without hair is obtained by subtracting the point cloud of the hair area, so as to accurately calculate the volume of the Tibetan sheep, and on this basis, the body weight of the Tibetan sheep is calculated, the measurement of the carcass size information of the to-be-measured Tibetan sheep is completed, and the accuracy and safety of the measurement are effectively ensured.
[0092] Optionally, according to the first hair density and the second hair density, the hair thickness of the to-be-measured Tibetan sheep and the individual information of the to-be-measured Tibetan sheep are determined, comprising:
[0093] According to the product of the first hair density and the first preset weight coefficient, and the product of the second hair density and the second preset weight coefficient, the third hair density information of the to-be-measured Tibetan sheep is determined.
[0094] According to the hair thickness of the to-be-measured Tibetan sheep and the third hair density information, the hair thickness of the to-be-measured Tibetan sheep is determined.
[0095] According to the hair thickness of the to-be-measured Tibetan sheep and the third hair density information, the individual information of the to-be-measured Tibetan sheep is determined.
[0096] In the present application, according to the product of the first hair density and the first preset weight coefficient, and the product of the second hair density and the second preset weight coefficient, the third hair density information of the to-be-measured Tibetan sheep is determined.
[0097] Specifically, the joint analysis formula of the third hair density information is specifically:
[0098] ;
[0099] wherein, and are the first preset weight coefficient and the second preset weight coefficient respectively, is the first hair density, is the second hair density.
[0100] More specifically, in the embodiments of the present application, in order to improve the accuracy of hair density estimation, illumination changes and shadow analysis can be combined. By considering the strength of the light and the depth of the shadow, the distribution and density of the hair can be more comprehensively inferred. Through the analysis of light and shadow, the distribution of hair in the image can be estimated. The shadow area usually represents the place where the hair is more dense, while the area with strong light may represent the area where the hair is more sparse. Combining these information, the density of the hair can be effectively inferred, and valuable data can be provided for subsequent body shape and weight estimation.
[0101] Hair thickness and body shape relationship:
[0102]
[0103] wherein, is the hair thickness, is the body size information of the Tibetan sheep to be measured, is used to calculate the relationship between hair thickness and body shape.
[0104] In the present application, hair thickness is an important factor in determining the individual information of Tibetan sheep. The physical characteristics of hair, such as thickness, color, and texture, are related to the individual information of Tibetan sheep, such as breed, age, and gender. For example, different breeds of Tibetan sheep may have different hair characteristics, which can be identified by analyzing the physical characteristics of hair.
[0105] Combining the body size information with hair and hair thickness, the individual information of Tibetan sheep can be more accurately determined. For example, by analyzing the thickness and growth cycle of hair, the age and breed of Tibetan sheep can be inferred.
[0106] In the present application, by combining the measurement of hair density and body size information, the hair thickness and individual information of the Tibetan sheep to be measured can be effectively determined, providing a scientific basis for the breeding, health monitoring and management of Tibetan sheep.
[0107] Optionally, the hair shadow area analysis of the first image of the Tibetan sheep to be measured to determine the first hair density of the Tibetan sheep to be measured comprises:
[0108] After image preprocessing of the first image, the Tibetan sheep image area in the first image is identified by edge detection algorithm;
[0109] The hair shadow area of the Tibetan sheep in the Tibetan sheep image area is determined by the gray value change information of each pixel point in the Tibetan sheep image area;
[0110] The first hair density of the Tibetan sheep to be measured is determined according to the ratio between the area of each hair shadow area of the Tibetan sheep and the area of the Tibetan sheep image area.
[0111] In the present application, first, the first image of the Tibetan sheep to be measured is pre-processed to enhance the contrast of the image, making the distinction between hair and non-hair regions more obvious. This can be achieved by histogram equalization and other methods, the purpose is to improve the distinction between hair and background in the image.
[0112] The edges in the Tibetan sheep image region are identified using edge detection algorithms such as Sobel operator, Robert operator or Canny operator. These algorithms can highlight the boundaries of the hair in the image, providing a basis for subsequent hair shadow region identification.
[0113] The hair shadow region is determined by analyzing the gray value change information of each pixel point in the Tibetan sheep image region. The shadow region usually shows a region with high gray value, which can be achieved by threshold segmentation method, identifying the region with gray value higher than a certain threshold as the shadow region.
[0114] The area of each hair shadow region is calculated. This can be done by image segmentation and region labeling method, marking all the shadow regions and calculating their total area.
[0115] The first hair density of the Tibetan sheep to be measured is determined according to the ratio between the area of the hair shadow region and the area of the Tibetan sheep image region. This ratio can reflect the density of the hair, the larger the area ratio, the higher the hair density
[0116] Finally, the number of hairs is divided by the area of the hair region to be detected to calculate the first hair density of the Tibetan sheep to be measured.
[0117] In the present application, the high-density region of the hair usually blocks the light, resulting in insufficient illumination in the local region, thus forming a shadow. The shadow region usually has a deep gray value in the image, so by detecting the shadow in the image, the region with dense hair can be inferred, thus effectively realizing the measurement of the first hair density of the Tibetan sheep to be measured.
[0118] Optionally, the second hair density of the Tibetan sheep to be measured is estimated according to the brightness value of each pixel region in the first image, comprising:
[0119] The brightness value of each pixel region in the first image is determined by local brightness analysis method;
[0120] The pixel region with brightness value greater than the first preset threshold is regarded as the high-density hair region, and the pixel region with brightness value lower than the second preset threshold is regarded as the low-density hair region;
[0121] The second hair density of the Tibetan sheep to be measured is determined according to the ratio of the brightness value of the low-density hair region to the brightness value of the high-density hair region.
[0122] In the present application, higher density hair can result in lower reflectance, and thus lower luminance values in the image; while lower density hair can reflect more light, resulting in higher luminance. Therefore, the first image can be analyzed using a local luminance analysis method to determine the luminance values of each pixel region in the first image. This method can involve local weighted averaging or filtering to calculate the intensity of light for each region.
[0123] Pixel regions with luminance values greater than a first predetermined threshold are identified as high-density hair regions, which typically have higher hair density because they reflect less light, resulting in lower luminance values. Correspondingly, pixel regions with luminance values lower than a second predetermined threshold are identified as low-density hair regions, which have lower hair density because they reflect more light, resulting in higher luminance values.
[0124] The second hair density of the Tibetan sheep under test is determined based on the ratio of the luminance values of the low-density hair regions to the luminance values of the high-density hair regions. This ratio can reflect the density of the hair and provide a quantitative estimate of the hair density. Specifically, if the luminance values of the high-density hair regions are lower and the luminance values of the low-density hair regions are higher, this ratio will be used to determine the second hair density of the Tibetan sheep under test.
[0125] In the present application, by combining the local luminance analysis method and the threshold segmentation technique, the second hair density of the Tibetan sheep under test can be effectively estimated, providing accurate data support for further analysis and evaluation.
[0126] Optionally, before the step of inputting the carcass point cloud data of the Tibetan sheep under test into the PointNet network and outputting the key point information of the carcass of the Tibetan sheep under test, the method further comprises:
[0127] Obtaining a plurality of point cloud sample information carrying key point labels;
[0128] Sending each of the point cloud sample information to a preset PointNet network to output a predicted key point corresponding to the point cloud sample information;
[0129] Based on the predicted key point and the key point label, calculating a loss value, and stopping training if the loss value is lower than a third predetermined threshold to obtain the PointNet network.
[0130] In the present application, the point cloud data of the Tibetan sheep under test is obtained by laser scanning, depth camera, etc. These devices can capture the three-dimensional coordinate information of the surface of the Tibetan sheep to form a point cloud dataset. In the obtained point cloud data, the positions of key points such as the head, chest, limbs, etc. need to be labeled. These key points will be used as labels in the training data for subsequent model training and key point detection to obtain a plurality of point cloud sample information carrying key point labels.
[0131] In the present application, the PointNet model can directly process point clouds, learn the corresponding spatial code for each point in the input point cloud, and then obtain a global point cloud feature using the features of all points. This global feature can be used for classification tasks or key point detection.
[0132] PointNet is trained using PointNet, which inputs unordered point cloud data, extracts global and local features of point clouds through multiple layers of perception (MLP) and maximum pooling operations. PointNet uses the maximum pooling operation to capture the global features of the unordered point set, ensuring that the order of the input point cloud does not affect the output:
[0133] ;
[0134] wherein, is the feature extraction for each point, and the pooling operation generates a global feature representation. During training, the mean square error loss function is used to regress the position of the key point:
[0135] ;
[0136] wherein, K is the number of key points, and are the predicted key point position and the true label position, respectively. After training, the model can predict the key points of new point cloud data and output the key positions of the object. Based on these predicted key points, the body length, body height, body width, etc. of the sheep can be calculated.
[0137] The advantage of PointNet is that it can directly process unordered point cloud data without converting the data into a grid or voxel format, and can effectively extract the geometric features of the object, so it has high efficiency and robustness in body size measurement and key point detection. This method is widely used in animal body size measurement tasks.
[0138] The Tibetan sheep individual and body size information recognition device provided by the present application is described below. The Tibetan sheep individual and body size information recognition device described below can be mutually corresponding to the Tibetan sheep individual and body size information recognition method described above.
[0139] Figure 2 The structure diagram of the Tibetan sheep individual and body size information recognition device provided by the present application is shown in Figure 2 , which includes:
[0140] The analysis module 210 is used for hair shadow area analysis of the first image of the Tibetan sheep to be measured, and determines the first hair density of the Tibetan sheep to be measured.
[0141] The estimation module 220 is configured to estimate a second hair density of the to-be-tested Tibetan sheep according to the brightness value of each pixel region in the first image;
[0142] The determination module 230 is configured to determine the hair thickness of the to-be-tested Tibetan sheep and individual information of the to-be-tested Tibetan sheep according to the first hair density and the second hair density;
[0143] The segmentation module 240 is configured to segment the whole point cloud data of the to-be-tested Tibetan sheep according to the hair thickness of the to-be-tested Tibetan sheep, and determine the carcass point cloud data of the to-be-tested Tibetan sheep;
[0144] The recognition module 250 is configured to determine the carcass size information of the to-be-tested Tibetan sheep according to the carcass point cloud data of the to-be-tested Tibetan sheep.
[0145] The Tibetan sheep individual and size information recognition device provided by the application is also used for:
[0146] The determination module 230 is configured to determine the third hair density information of the to-be-tested Tibetan sheep according to the product of the first hair density and a first preset weight coefficient, and the product of the second hair density and a second preset weight coefficient;
[0147] The determination module 230 is configured to determine the hair thickness of the to-be-tested Tibetan sheep according to the hair-covered size information of the to-be-tested Tibetan sheep and the third hair density information;
[0148] The determination module 230 is configured to determine the individual information of the to-be-tested Tibetan sheep according to the hair-covered size information of the to-be-tested Tibetan sheep and the hair thickness.
[0149] The Tibetan sheep individual and size information recognition device provided by the application is also used for:
[0150] After the image preprocessing of the first image, the Tibetan sheep image region in the first image is recognized through an edge detection algorithm;
[0151] The Tibetan sheep hair shadow region in the Tibetan sheep image region is determined through the gray value change information of each pixel point in the Tibetan sheep image region;
[0152] The first hair density of the to-be-tested Tibetan sheep is determined according to the ratio between the area of each Tibetan sheep hair shadow region and the area of the Tibetan sheep image region.
[0153] The Tibetan sheep individual and size information recognition device provided by the application is also used for:
[0154] The brightness value of each pixel region in the first image is determined by analyzing the first image through a local brightness analysis method;
[0155] Pixel regions with brightness values greater than a first preset threshold are designated as high-density hair regions, and pixel regions with brightness values lower than a second preset threshold are designated as low-density hair regions.
[0156] The second hair density of the Tibetan sheep to be tested is determined based on the ratio of the brightness value of the low-density hair area to the brightness value of the high-density hair area.
[0157] According to the Tibetan sheep individual and body size information identification device provided by the present invention, the device is further used for:
[0158] The point cloud data of the Tibetan sheep carcass to be tested is input into the PointNet network, and the key points of the Tibetan sheep carcass to be tested are output; the key points include at least one of the following: head key points, chest key points and limb key points;
[0159] The body size information of the Tibetan sheep carcass is calculated based on the Euclidean distance between key points of the carcass.
[0160] According to the Tibetan sheep individual and body size information identification device provided by the present invention, the device is further used for:
[0161] Acquire multiple point cloud sample information carrying key point labels;
[0162] Each point cloud sample information is sent to a preset PointNet network, and the predicted key points corresponding to the point cloud sample information are output.
[0163] Based on the predicted keypoints and the keypoint labels, a loss value is calculated. If the loss value is lower than a third preset threshold, training is stopped, and the PointNet network is obtained.
[0164] In this invention, because areas with higher hair density typically block more light, forming deeper shadows, hair density can be estimated by analyzing the area and depth of shadow regions to determine a first hair density. Local brightness analysis methods, such as local weighted averaging or filtering, can calculate the light intensity of each area, thus inferring that areas with weaker light are likely to have denser hair, determining a second hair density. Combining the first and second hair densities, the hair thickness and individual information of the Tibetan sheep can be determined. Based on the hair thickness of the Tibetan sheep to be measured, the point cloud of the hair-free area is subtracted to obtain the carcass point cloud, thereby accurately calculating the volume of the Tibetan sheep. Based on this, its weight can be estimated, completing the measurement of the carcass size information of the Tibetan sheep to be measured, effectively ensuring the accuracy and safety of the measurement.
[0165] Figure 3 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 3As shown, the electronic device can include a processor 310, a communications interface 320, a memory 330, and a communications bus 340, wherein the processor 310, the communications interface 320, and the memory 330 communicate with each other through the communications bus 340. The processor 310 can invoke the logical instructions in the memory 330 to execute the Tibetan sheep individual and body size information identification method, which includes: performing hair shadow area analysis on a first image of a Tibetan sheep to be tested to determine the first hair density of the Tibetan sheep to be tested;
[0166] According to the brightness value of each pixel region in the first image, the second hair density of the Tibetan sheep to be tested is estimated;
[0167] According to the first hair density and the second hair density, the hair thickness of the Tibetan sheep to be tested and the individual information of the Tibetan sheep to be tested are determined;
[0168] According to the hair thickness of the Tibetan sheep to be tested, the overall point cloud data of the Tibetan sheep to be tested is segmented to determine the carcass point cloud data of the Tibetan sheep to be tested;
[0169] According to the carcass point cloud data of the Tibetan sheep to be tested, the carcass size information of the Tibetan sheep to be tested is determined.
[0170] In addition, the logical instructions in the memory 330 described above can be implemented in the form of a software function unit and sold or used as an independent product, which can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or parts of the present application that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for making a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0171] On the other hand, the present application also provides a computer program product, which includes a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program can be executed by a processor to enable a computer to execute the Tibetan sheep individual and body size information identification method provided by the above-mentioned methods, which includes: performing hair shadow area analysis on a first image of a Tibetan sheep to be tested to determine the first hair density of the Tibetan sheep to be tested;
[0172] According to the brightness value of each pixel area in the first image, the second hair density of the to-be-tested Tibetan sheep is estimated;
[0173] According to the first hair density and the second hair density, the hair thickness of the to-be-tested Tibetan sheep and individual information of the to-be-tested Tibetan sheep are determined;
[0174] According to the hair thickness of the to-be-tested Tibetan sheep, the overall point cloud data of the to-be-tested Tibetan sheep is segmented to determine the carcass point cloud data of the to-be-tested Tibetan sheep;
[0175] According to the carcass point cloud data of the to-be-tested Tibetan sheep, the carcass size information of the to-be-tested Tibetan sheep is determined.
[0176] In another aspect, the present application also provides a non-transitory computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the Tibetan sheep individual and size information identification method provided by the above method, the method comprising: performing hair shadow area analysis on a first image of a to-be-tested Tibetan sheep to determine a first hair density of the to-be-tested Tibetan sheep;
[0177] According to the brightness value of each pixel area in the first image, the second hair density of the to-be-tested Tibetan sheep is estimated;
[0178] According to the first hair density and the second hair density, the hair thickness of the to-be-tested Tibetan sheep and individual information of the to-be-tested Tibetan sheep are determined;
[0179] According to the hair thickness of the to-be-tested Tibetan sheep, the overall point cloud data of the to-be-tested Tibetan sheep is segmented to determine the carcass point cloud data of the to-be-tested Tibetan sheep;
[0180] According to the carcass point cloud data of the to-be-tested Tibetan sheep, the carcass size information of the to-be-tested Tibetan sheep is determined.
[0181] The device embodiments described above are only schematic, wherein the units shown as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment. Those skilled in the art can understand and implement without creative labor.
[0182] Those skilled in the art can clearly understand the technical solutions of the various embodiments from the above description of the embodiments, and the various embodiments can be implemented by means of software with the necessary general hardware platforms, and of course, can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in other words, the part of the prior art that makes a contribution, can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, and the like, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0183] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for some technical features therein; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for identifying Tibetan sheep individual and body size information, characterized in that, The method comprises the following steps: carrying out hair shadow area analysis on a first image of a to-be-tested Tibetan sheep to determine a first hair density of the to-be-tested Tibetan sheep; estimating a second hair density of the to-be-tested Tibetan sheep according to the brightness values of each pixel region in the first image; determining the hair thickness of the to-be-tested Tibetan sheep and individual information of the to-be-tested Tibetan sheep according to the first hair density and the second hair density; segmenting the overall point cloud data of the to-be-tested Tibetan sheep according to the hair thickness of the to-be-tested Tibetan sheep to determine the carcass point cloud data of the to-be-tested Tibetan sheep; determining the carcass size information of the to-be-tested Tibetan sheep according to the carcass point cloud data of the to-be-tested Tibetan sheep; wherein the step of carrying out hair shadow area analysis on a first image of a to-be-tested Tibetan sheep to determine a first hair density of the to-be-tested Tibetan sheep comprises the following steps: after image preprocessing of the first image, recognizing the Tibetan sheep image region in the first image through an edge detection algorithm; determining the Tibetan sheep hair shadow region in the Tibetan sheep image region through the gray value change information of each pixel point in the Tibetan sheep image region; determining the first hair density of the to-be-tested Tibetan sheep according to the ratio between the area of each Tibetan sheep hair shadow region and the area of the Tibetan sheep image region; wherein the step of estimating a second hair density of the to-be-tested Tibetan sheep according to the brightness values of each pixel region in the first image comprises the following steps: determining the brightness values of each pixel region in the first image by analyzing the first image through a local brightness analysis method; regarding the pixel region with a brightness value greater than a first preset threshold value as a high-density hair region, and regarding the pixel region with a brightness value lower than a second preset threshold value as a low-density hair region; determining the second hair density of the to-be-tested Tibetan sheep according to the ratio between the brightness value of the low-density hair region and the brightness value of the high-density hair region.
2. The method according to claim 1, wherein determining the hair thickness of the to-be-tested Tibetan sheep and individual information of the to-be-tested Tibetan sheep according to the first hair density and the second hair density comprises the following steps: determining third hair density information of the to-be-tested Tibetan sheep according to the product of the first hair density and a first preset weight coefficient, and the product of the second hair density and a second preset weight coefficient; determining the hair thickness of the to-be-tested Tibetan sheep according to the hair-covered body size information of the to-be-tested Tibetan sheep and the third hair density information; determining the individual information of the to-be-tested Tibetan sheep according to the hair-covered body size information of the to-be-tested Tibetan sheep and the hair thickness.
3. The method according to claim 1, wherein the method is characterized by, determining the carcass size information of the to-be-tested Tibetan sheep according to the carcass point cloud data of the to-be-tested Tibetan sheep comprises the following steps: inputting the carcass point cloud data of the to-be-tested Tibetan sheep into a PointNet network to output key points of the carcass of the to-be-tested Tibetan sheep; the key points comprise at least one of the following: head key points, chest key points and limb key points; calculating the carcass size information of the to-be-tested Tibetan sheep based on the Euclidean distance between the key points of the carcass of the to-be-tested Tibetan sheep.
4. The method according to claim 3, wherein the method is characterized by, Before the step of inputting the carcass point cloud data of the to-be-tested Tibetan sheep into a PointNet network to output key point information of the carcass of the to-be-tested Tibetan sheep, the method further comprises the following steps: obtaining a plurality of point cloud sample information carrying key point labels; Send each point cloud sample information to a preset PointNet network, output the predicted key point corresponding to the point cloud sample information; Based on the predicted key point and the key point label, calculate the loss value, and stop training if the loss value is lower than a third preset threshold, to obtain the PointNet network.
5. A device for identifying individual and body size information of Tibetan sheep, characterized in that, Comprise: The analysis module is used for analyzing the hair shadow area of the first image of the Tibetan sheep to be tested, and determining the first hair density of the Tibetan sheep to be tested; The estimation module is used for estimating the second hair density of the Tibetan sheep to be tested according to the brightness value of each pixel region in the first image; The determination module is used for determining the hair thickness of the Tibetan sheep to be tested and the individual information of the Tibetan sheep to be tested according to the first hair density and the second hair density; The segmentation module is used for segmenting the overall point cloud data of the Tibetan sheep to be tested according to the hair thickness of the Tibetan sheep to be tested, and determining the carcass point cloud data of the Tibetan sheep to be tested; The identification module is used for determining the carcass size information of the Tibetan sheep to be tested according to the carcass point cloud data of the Tibetan sheep to be tested; The first image of the Tibetan sheep to be tested is analyzed to determine the first hair density of the Tibetan sheep to be tested, comprising: After image preprocessing of the first image, the Tibetan sheep image region in the first image is identified by an edge detection algorithm; The Tibetan sheep hair shadow region in the Tibetan sheep image region is determined by the gray value change information of each pixel point in the Tibetan sheep image region; The first hair density of the Tibetan sheep to be tested is determined according to the ratio between the area of each Tibetan sheep hair shadow region and the area of the Tibetan sheep image region; The first image is analyzed by a local brightness analysis method to determine the brightness value of each pixel region in the first image; The pixel region with a brightness value greater than a first preset threshold is regarded as a high-density hair region, and the pixel region with a brightness value lower than a second preset threshold is regarded as a low-density hair region; The second hair density of the Tibetan sheep to be tested is determined according to the ratio between the brightness value of the low-density hair region and the brightness value of the high-density hair region. The processor executes the computer program to realize the Tibetan sheep individual and size information identification method of any one of claims 1 to 4.
6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The computer program is executed by the processor to realize the Tibetan sheep individual and size information identification method of any one of claims 1 to 4.
7. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the Tibetan sheep individual and size information identification method of any one of claims 1 to 4.
8. A computer program product comprising a computer program, characterized in that,
Citation Information
Patent Citations
Point cloud quality evaluation method and device
CN107767375A
Blocking method and system based on livestock carcass point cloud image
CN114330490A