Animal carcass body size measuring method, device and equipment and readable storage medium

Deep learning technology is used to process depth maps and color images of animal carcasses to achieve efficient and accurate body measurement, solving the problems of low manual measurement efficiency and large errors, and supporting closed-loop management of breeding management.

CN118570843APending Publication Date: 2024-08-30MUYUAN FOODS GROUP CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410913976.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In the breeding industry, manual measurement of animal carcass body measurements is inefficient and has large errors, making it difficult to achieve efficient and accurate body measurement and affecting breeding and management.

Method used

Deep learning technology is used to obtain the depth map and color image of the animal carcass, perform target detection and key point detection, and calculate the body size of the animal carcass, including the chest half carcass detection frame, key point coordinates and spatial coordinates, and calculate the body size ruler.

Benefits of technology

It realizes automated animal carcass body measurement, reduces errors and labor waste caused by manual measurement, improves the accuracy and efficiency of breeding management, and supports closed-loop management of the entire pig process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570843A
    Figure CN118570843A
Patent Text Reader

Abstract

The invention discloses an animal carcass body size measurement method, device and equipment and a readable storage medium, which are applied to the field of animal body size measurement, and comprise the following steps: acquiring an original image of an animal carcass production line; the original image is composed of a depth image and a color image; performing target detection and image extraction on the color image to obtain a target image corresponding to the chest half-carcass detection frame; performing key point detection on the target image to obtain key point coordinates; the key points are used for measuring body scales; mapping the coordinates of the key points to the depth map to obtain space coordinates of the key points; and calculating the body size according to the space coordinates of the key points. The body size data of the animal carcass can be automatically calculated based on the deep learning technology, and the problems of errors, counterfeiting and manpower waste caused by manual measurement are solved. The paternal line and the maternal line are traced through the obtained body size data, breeding is guided, optimization iteration of breeding pigs is accelerated, and closed-loop management of the whole process of the live pigs is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of animal body size measurement, and in particular to an animal carcass body size measurement method, device, equipment and a readable storage medium. Background Art

[0002] Artificial intelligence is developing rapidly. In the breeding industry, various measurements still rely on manual labor, which is costly, has large errors, and is difficult to unify. However, the measurement of animal body size is of great value. For example, the body size of a pig carcass is used to trace its paternal and maternal lines. For pigs with poor offspring growth and low success rate, it is necessary to quickly eliminate its paternal and maternal lines, select excellent breeding pigs and iterate the pig herd to improve the quality of the entire herd, breed higher-value pigs, and increase the company's pig farming profits.

[0003] Therefore, how to efficiently and accurately measure the body size of animal carcasses is an urgent problem that needs to be solved. Summary of the invention

[0004] In view of this, an object of the present invention is to provide a method, device, equipment and readable storage medium for measuring the body size of an animal carcass, which solves the problems of manual measurement and low efficiency in the prior art.

[0005] In order to solve the above technical problems, the present invention provides a method for measuring the body size of an animal carcass, comprising:

[0006] Acquire an original image of an animal carcass production line; the original image is composed of a depth map and a color map;

[0007] Performing target detection and image extraction on the color image to obtain a target image corresponding to a chest cavity half-carcass detection frame;

[0008] Performing key point detection on the target image to obtain key point coordinates; the key points are used to measure body size;

[0009] Mapping the key point coordinates onto the depth map to obtain the spatial coordinates of the key points;

[0010] The body size is calculated according to the spatial coordinates of the key points.

[0011] Optionally, performing target detection and image extraction on the color image to obtain a target image corresponding to a chest cavity half-carcass detection frame includes:

[0012] Inputting the color image into a target detection model to obtain a plurality of animal carcass detection frames;

[0013] The plurality of animal carcass detection frames are screened according to preset label values, and the detection frame of the thorax of the half-carcass is used as the thorax half-carcass detection frame;

[0014] The image corresponding to the thoracic half-carcass detection frame in the color image is extracted as the target image.

[0015] Optionally, after the detection frame of the thorax of the half-carcass is used as the thorax half-carcass detection frame, the method further includes:

[0016] If there are multiple thoracic half-section carcass detection frames, then obtaining the coordinate value of the upper left corner of each thoracic half-section carcass detection frame;

[0017] According to the coordinate value of the upper left corner, each thoracic half-section carcass detection frame is sorted from large to small.

[0018] Optionally, after performing target detection and image extraction on the color image to obtain a target image corresponding to the chest cavity half-carcass detection frame, the method further includes:

[0019] Inputting the thoracic half-carcass detection frame into a target tracking model to obtain a serial number of the thoracic half-carcass detection frame;

[0020] Accordingly, the body size is calculated according to the spatial coordinates of the key points, including:

[0021] The spatial coordinates of the key points are sequentially stored in the data sets corresponding to the numbers;

[0022] When no new spatial coordinates are stored within a preset time period, the body size is calculated based on all data in the current data set.

[0023] Optionally, inputting the thorax half-carcass detection frame into a target tracking model to obtain a serial number of the thorax half-carcass detection frame includes:

[0024] Inputting the thoracic half-carcass detection frame into the target tracking model and outputting the result;

[0025] If the result is empty, a new number is assigned to the thoracic half-carcass detection frame;

[0026] If the result is not empty, a matching algorithm is used to determine the serial number corresponding to the thoracic half-carcass detection frame.

[0027] Optionally, performing key point detection on the target image to obtain key point coordinates includes:

[0028] Input the target image into the key point detection model to obtain the key point coordinates; the key points include the midpoint of the front edge of the pubic symphysis, the midpoint of the front edge of the first cervical vertebra, the intersection of the first rib and the sternum, and the midpoint of the distance from the sixth to the seventh rib;

[0029] Accordingly, the body size is calculated according to the spatial coordinates of the key points, including:

[0030] The straight length of the carcass is calculated based on the spatial coordinates of the midpoint of the front edge of the pubic symphysis and the midpoint of the front edge of the first cervical vertebra;

[0031] The oblique length of the carcass is calculated based on the spatial coordinates of the midpoint of the front edge of the pubic symphysis and the spatial coordinates of the intersection of the first rib and the sternum;

[0032] The back fat thickness was calculated based on the spatial coordinates of the midpoint between the sixth and seventh ribs.

[0033] Optionally, mapping the coordinates of the midpoint of the distance between the sixth and seventh ribs to the depth map to obtain the spatial coordinates of the midpoint of the distance between the sixth and seventh ribs includes:

[0034] Extracting a back fat region image in the target image according to the coordinates of the midpoint of the distance from the sixth to the seventh rib and a preset extraction condition;

[0035] Inputting the back fat region image into a semantic segmentation model to obtain a back fat region mask;

[0036] Obtaining a mask coordinate list according to the back fat area mask, the coordinates of the midpoint of the distance from the sixth to the seventh rib, and a preset range interval;

[0037] The spatial coordinates of the midpoint of the distance from the sixth to the seventh rib are calculated according to the mask coordinate list and the depth map.

[0038] The present invention also provides an animal carcass body size measuring device, comprising:

[0039] An image acquisition module, used to acquire an original image of an animal carcass production line; the original image is composed of a depth image and a color image;

[0040] A target detection module, used for performing target detection and image extraction on the color image to obtain a target image corresponding to a detection frame of the thoracic half-carcass;

[0041] A key point detection module, used to detect key points of the target image to obtain key point coordinates; the key points are used to measure body size;

[0042] A mapping module, used to map the key point coordinates to the depth map to obtain the spatial coordinates of the key points;

[0043] The body size calculation module is used to calculate the body size according to the spatial coordinates of the key points.

[0044] The present invention also provides an animal carcass size measuring device, comprising:

[0045] Memory for storing computer programs;

[0046] A processor is used to implement the steps of the above-mentioned animal carcass body size measurement method when executing the computer program.

[0047] The present invention also provides a readable storage medium, in which computer executable instructions are stored. When the computer executable instructions are loaded and executed by a processor, the steps of the above-mentioned animal carcass body size measurement method are implemented.

[0048] It can be seen that the present invention obtains the original image of the animal carcass production line; the original image is composed of a depth map and a color map; target detection and image extraction are performed on the color map to obtain a target image corresponding to the thoracic half-carcass detection frame; key point detection is performed on the target image to obtain the key point coordinates; the key points are used to measure body size; the key point coordinates are mapped to the depth map to obtain the spatial coordinates of the key points; the body size is calculated according to the spatial coordinates of the key points. The present invention can automatically calculate the body size data of animal carcasses based on deep learning technology, solving the problems of errors, fraud and waste of manpower caused by manual measurement. The body size data obtained by the present invention can trace back to its paternal and maternal lines, guide breeding, accelerate the optimization and iteration of breeding pigs, and realize closed-loop management of the entire process of live pigs.

[0049] In addition, the present invention also provides an animal carcass body size measuring device, equipment and readable storage medium, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] 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, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0051] Figure 1 A flow chart of a method for measuring the body size of an animal carcass provided by an embodiment of the present invention;

[0052] Figure 2 An example diagram of a target detection result provided by an embodiment of the present invention;

[0053] Figure 3 A schematic structural diagram of an animal carcass body size measuring device provided by an embodiment of the present invention;

[0054] Figure 4 A schematic structural diagram of an animal carcass size measuring device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0056] Please refer to Figure 1 , Figure 1 A flow chart of a method for measuring the body size of an animal carcass provided in an embodiment of the present invention. The method may include:

[0057] S101: Acquire an original image of an animal carcass production line; the original image is composed of a depth image and a color image.

[0058] The executor of this embodiment is a terminal. This embodiment does not limit the type of terminal, as long as it can complete the operation of the animal carcass body size measurement method. The animal carcass in this embodiment can be a pig carcass, or it can also be a cattle carcass; or it can also be a sheep carcass. This embodiment uses an RGBD (RGB-D is an image data format that combines color and depth information) camera to capture video on the carcass production line, and can obtain the original image from the video. The original image is composed of a depth map and a color map (RGB map). You can refer to Figure 2 ,Depend on Figure 2 The original image of the meat carcass production line in this embodiment can be seen. Specifically, the RGBD camera is installed on a fixed bracket, the bracket is fixed on the carcass production line, and the camera is installed at a certain angle to the carcass, such as an angle between 40° and 50°. During the operation of the production line, the RGBD camera continuously collects data and transmits the collected data to the industrial computer through a network cable, wherein the collected data is 3D point cloud data, which is a collection of a bunch of 3D coordinate points x, y, and z. The original image is obtained by transforming a series of collected 3D point cloud data. If the frame rate of the RGBD camera is 5 frames per second, 5 frames of images can be collected per second, and RGB images and depth images can be continuously output.

[0059] S102: Performing target detection and image extraction on the color image to obtain a target image corresponding to a chest cavity half-carcass detection frame.

[0060] This embodiment uses a pre-trained target detection model to detect the color image, and marks the chest half carcass in the color image for detection. Figure 2As shown, the target image corresponding to the chest half carcass detection frame in the color image is extracted. This embodiment does not limit the target detection model. For example, it can be YOLO (You Only Look Once, a target detection technology) detection, including YOLOV5, YOLOV8 (a real-time target detection model), SSD (Single Shot MultiBox Detector, a single-stage target detection method) and other mainstream target detection models.

[0061] Furthermore, the above-mentioned target detection and image extraction are performed on the color image to obtain the target image corresponding to the chest cavity half carcass detection frame, which may specifically include the following steps:

[0062] Step 11: Input the color image into the target detection model to obtain multiple animal carcass detection frames;

[0063] Step 12: screening multiple animal carcass detection frames according to preset label values, and using the detection frame of the thorax of the half-carcass as the thorax half-carcass detection frame;

[0064] Step 13: Extract the image corresponding to the chest half-section carcass detection frame in the color image as the target image.

[0065] Specifically, this embodiment inputs the color image into the target detection model to obtain multiple animal carcass detection frames, and the detection frame can frame the back or chest of an animal carcass. Therefore, it is necessary to further screen each animal carcass detection frame and only retain the chest half-section detection frame. Specifically, each animal carcass detection frame is screened using the label value, wherein the label value is the label of the back and chest surface. The chest half-section carcass detection frame is extracted from the image corresponding to the color image to obtain the target image. Specifically, the target area is taken out on the color image according to the coordinates of the chest half-section carcass detection frame, and is centered on an 800*400 picture with a value of 0 to obtain the target image.

[0066] S103: Detect key points of the target image to obtain key point coordinates; the key points are used to measure body size.

[0067] This embodiment performs key point detection on the target image to obtain the coordinates of the corresponding parts. This embodiment does not limit the key point detection model. For example, the key point model can use Transpose (a posture estimation technology), including but not limited to HrNet (High-Resolution Network, a high-resolution network structure), OpenPose (a real-time two-dimensional posture estimation software library) and other mainstream networks. It should be noted that the key points in this embodiment are used to measure body size, such as Figure 2If the body size is straight length, the corresponding key points are the two key points of straight length measurement; if the body size is oblique length, the corresponding key points are the two key points of oblique length measurement. Further, the above key point detection on the target image to obtain the key point coordinates may include the following steps:

[0068] The target image is input into the key point detection model to obtain the coordinates of the midpoint of the front edge of the pubic symphysis, the midpoint of the front edge of the first cervical vertebra, the intersection of the first rib and the sternum, and the midpoint of the distance from the sixth to the seventh rib.

[0069] Specifically, this embodiment uses the midpoint straight1 of the front edge of the pubic symphysis and the midpoint straight2 of the front edge of the first cervical vertebra to calculate the straight length of the carcass, uses the midpoint straight1 of the front edge of the pubic symphysis and the intersection diagonal of the first rib and the sternum to calculate the diagonal length of the carcass, and uses the midpoint shoulder of the distance from the sixth to the seventh rib to calculate the back fat thickness.

[0070] S104: Map the key point coordinates to the depth map to obtain the spatial coordinates of the key points.

[0071] This embodiment obtains the coordinates of key points based on the color image, maps them to the depth image to obtain the spatial coordinates of the key points, and calculates the body size of the animal carcass based on the spatial coordinates. For example, the three key points used to calculate the straight length and the oblique length are: straight1, the midpoint of the front edge of the pubic symphysis, straight2, the midpoint of the front edge of the first cervical vertebra, and diagonal, the intersection of the first rib and the sternum. Taking the coordinates of the current key point as the center, take the average of the depth values ​​of the 3*3 square area as the depth value v corresponding to the current key point, and calculate the corresponding X, Y, and Z values ​​using the following formula;

[0072] Z = v * scale;

[0073] X = Z * (x - cx) / fx;

[0074] Y = Z * (y - cy) / fy;

[0075] Among them, scale is the scale parameter of the RGBD camera, and cx, cy, fx, and fy are the internal parameters of the RGBD camera.

[0076] S105: Calculate the body size according to the spatial coordinates of the key points.

[0077] In this embodiment, body size is calculated based on the spatial coordinates of key points. For example, the straight length of the carcass can be calculated using the spatial coordinates of the midpoint straight1 of the front edge of the pubic symphysis and the midpoint straight2 of the front edge of the first cervical vertebra, the oblique length of the carcass can be calculated using the spatial coordinates of the midpoint straight1 of the front edge of the pubic symphysis and the intersection of the first rib and the sternum diagonal, and the back fat thickness can be calculated using the spatial coordinates of the midpoint shoulder between the sixth and seventh ribs.

[0078] Furthermore, after the detection frame of the thorax of the half-carcass is used as the thorax half-carcass detection frame, the following steps may also be included:

[0079] Step 21: If there are multiple thoracic half-carcass detection frames, obtain the coordinate value of the upper left corner of each thoracic half-carcass detection frame;

[0080] Step 22: Sort the chest half-carcass detection frames from large to small according to the coordinate value of the upper left corner.

[0081] Specifically, this embodiment sorts all the chest half-section carcass detection frames from large to small according to the upper left corner coordinate x1, ensuring that the detection frame close to the RGBD camera is always ranked first. Considering that the detection frame recognition output may not be consistent with the order on the production line, sorting is performed. In other words, object 1 is in front of object 2 on the production line, that is, under normal circumstances, object 1 appears first in the acquisition field of view of the RGBD camera, and the target detection model should first output the data of the detection frame of object 1. However, there are special cases where object 1 and object 2 appear in the acquisition field of view of the RGBD camera at the same time. The target detection model first outputs the data of the detection frame of object 2, and then outputs the detection frame data of object 1. At this time, steps 21 and 23 of this embodiment can be used to ensure that the detection frame close to the RGBD camera (that is, object 1) is always ranked first.

[0082] Furthermore, after performing target detection and image extraction on the color image to obtain the target image corresponding to the chest cavity half carcass detection frame, the following steps may also be included:

[0083] The thorax half-carcass detection frame is input into the target tracking model to obtain the number of the thorax half-carcass detection frame; accordingly, the body size is calculated according to the spatial coordinates of the key points, including: the spatial coordinates of the key points are stored in the data set corresponding to the number in sequence; when no new spatial coordinates are stored within a preset time period, the body size is calculated based on all data in the current data set.

[0084] Specifically, this embodiment performs an association analysis between the current original image and the previous original image. For example, a target object may appear in multiple images. In this case, this embodiment does not only calculate the body size of the target object based on the current original image, but calculates the body size of the target object based on the key point data obtained from all images related to the target object. This embodiment does not limit the target tracking model. The target tracking model can use the mainstream SORT (Simple Online and Realtime Tracking, a target tracking algorithm) tracking algorithm, including but not limited to DeepSORT (Deep learning based SORT, a visual target tracking algorithm based on deep learning) and a series of tracking algorithms. The chest cavity half-carcass detection frame is input into the target tracking model to obtain a detection frame with an ID (number, the number assigned to each detection frame by the target tracking algorithm, 1, 2, 3...). The ID number of the same object is consistent between different frames of the camera, and the key point coordinates obtained by the current original image recognition are stored in the corresponding data set through the ID of the detection frame. In other words, the different body size results calculated by multiple frames of images of the same object are placed in different lists, and data fusion is performed on each list respectively. Furthermore, the data in the list is detected in real time to eliminate the difference data. Specifically, it is iterated through a loop, each time each value in the list is subtracted from the mean of the list and the absolute value is calculated. The value with the largest error is eliminated in each loop until the length of the list meets the preset data length. The mean of the remaining data in the list is calculated as the final value of the body size, and the final body size feature of each object is output.

[0085] Furthermore, the step of inputting the thoracic half-carcass detection frame into the target tracking model to obtain the serial number of the thoracic half-carcass detection frame may include the following steps:

[0086] Step 31: Input the chest cavity half carcass detection frame into the target tracking model and output the result;

[0087] Step 32: If the result is empty, assign a new number to the chest cavity half carcass detection frame;

[0088] Step 33: If the result is not empty, a matching algorithm is used to determine the serial number corresponding to the chest cavity half carcass detection frame.

[0089] Specifically, the thoracic half-carcass detection frame is input into the target tracking model. If track (which is used to store detection frames with ID numbers, and the detection frames of the same object in different frames of the image have the same ID number) is empty, an ID is assigned to each detection frame, which means that the target object detected in the current image appears for the first time. If track is not empty, a matching algorithm is used to determine the number corresponding to the thoracic half-carcass detection frame, which means that the target object detected in the current image does not appear for the first time. The matching algorithm is then used to determine the number of the target object from track. This embodiment does not limit the matching algorithm. For example, the iou (intersection-over-union ratio, which indicates the degree of overlap between two detection frames) of each thoracic half-carcass detection frame detected in the current image is calculated with respect to each detection frame in track. The iou matrix obtained is matched using the Hungarian algorithm to assign a number to the current thoracic half-carcass detection frame.

[0090] Under normal circumstances, a target object should appear in multiple consecutive images, but there are special cases, such as errors in the target detection model, which causes a target object to appear in multiple discontinuous images. In this case, the following steps should be taken to correct it: calculate the center point of the chest half-carcass detection frame, determine whether the center point passes through the center line of the original image width direction (the center line is parallel to the y-axis), and when the chest half-carcass detection frame moves from the left side of the center line to the right side of the center line, record the number of carcasses crossing the center line plus 1, that is, the number of detected objects plus 1. At the same time, assign a value to the current track as its real ID number based on the number of carcasses crossing the line. This solves the problem of misdetection in the target detection model or the discontinuous appearance of the same target object in the image, resulting in the assigned ID number being inconsistent with the actual number of carcasses on the production line.

[0091] Furthermore, mapping the coordinates of the midpoint of the distance between the sixth and seventh ribs to the depth map to obtain the spatial coordinates of the midpoint of the distance between the sixth and seventh ribs may include the following steps:

[0092] Step 41: extracting the back fat area image in the target image according to the coordinates of the midpoint of the distance from the sixth to the seventh rib and the preset extraction conditions.

[0093] Specifically, this embodiment does not limit the preset extraction conditions. The following example can be referred to: according to the coordinates of the shoulder from the sixth to the seventh ribs at the midpoint, take 80 pixels above and below the x coordinate of the shoulder, take 320 pixels to the right from the y coordinate as the starting point, and obtain the coordinates of the upper left corner of the coordinate frame (x-80, y) and the lower right corner (x+80, y+320). According to the coordinates, the target area, i.e., the back fat area image, is taken out from the 800*400 picture in the target image.

[0094] Step 42: Input the back fat region image into the semantic segmentation model to obtain the back fat region mask.

[0095] Specifically, this embodiment does not limit the semantic segmentation model. For example, the semantic segmentation model can use OCRNet, including but not limited to one of a series of mainstream networks such as DeepLabV3 and Unet. Specifically, the back fat area image can be input into the OCRNet semantic segmentation model to obtain the back fat area mask.

[0096] Step 43: Obtain a mask coordinate list according to the back fat area mask, the coordinates of the midpoint of the distance from the sixth to the seventh rib, and the preset range interval.

[0097] Specifically, according to the coordinates of the shoulder from the sixth to the seventh ribs at the midpoint, five points are taken above and below the y coordinate of the shoulder, and each point with a mask value of 1 on the corresponding row is taken out, and each row obtains a list storing x and y coordinate points, that is, a mask coordinate list.

[0098] Step 44: Calculate the spatial coordinates of the midpoint of the distance from the sixth to the seventh rib according to the mask coordinate list and the depth map.

[0099] According to the coordinate values ​​in the mask coordinate list, the actual coordinate values ​​are calculated on the depth map, that is, the spatial coordinates of the midpoint of the distance between the sixth and seventh ribs. Specifically, the calculated distances between every two points in the mask coordinate list are accumulated to obtain the width of the back fat area of ​​the current row, and the widths of the back fat of ten rows are calculated in turn, and finally the sum is taken to obtain the average value to obtain the back fat thickness.

[0100] A method for measuring the body size of an animal carcass provided by an embodiment of the present invention is applied, by obtaining an original image of an animal carcass production line; the original image is composed of a depth map and a color map; target detection and image extraction are performed on the color map to obtain a target image corresponding to a detection frame of a thoracic half-carcass; key point detection is performed on the target image to obtain key point coordinates; the key points are used to measure body size; the key point coordinates are mapped to the depth map to obtain the spatial coordinates of the key points; the body size is calculated based on the spatial coordinates of the key points. The present invention can automatically calculate the body size data of an animal carcass based on deep learning technology, solving the problems of error, fraud and waste of manpower caused by manual measurement. The body size data obtained by the present invention can be traced back to its paternal and maternal lines to guide breeding, accelerate the optimization iteration of breeding pigs, and realize closed-loop management of the entire process of live pigs.

[0101] The following is an introduction to an animal carcass body size measuring device provided in an embodiment of the present invention. The animal carcass body size measuring device described below and the animal carcass body size measuring method described above can be referred to each other.

[0102] Please refer to Figure 3, Figure 3 A schematic structural diagram of an animal carcass body size measuring device provided by an embodiment of the present invention may include:

[0103] The image acquisition module 100 is used to acquire the original image of the animal carcass production line; the original image is composed of a depth image and a color image;

[0104] The target detection module 200 is used to perform target detection and image extraction on the color image to obtain a target image corresponding to the chest cavity half carcass detection frame;

[0105] A key point detection module 300 is used to detect key points of the target image to obtain key point coordinates; the key points are used to measure body size;

[0106] A mapping module 400, configured to map the key point coordinates onto the depth map to obtain the spatial coordinates of the key points;

[0107] The body size calculation module 500 is used to calculate the body size according to the spatial coordinates of the key points.

[0108] Based on the above embodiment, the target detection module 200 may include:

[0109] A target detection unit, used for inputting the color image into a target detection model to obtain a plurality of animal carcass detection frames;

[0110] A screening unit, configured to screen the plurality of animal carcass detection frames according to a preset label value, and use the detection frame of the thorax of the half-carcass as the thorax half-carcass detection frame;

[0111] The extraction unit is used to extract the image corresponding to the chest half-section carcass detection frame in the color image as the target image.

[0112] Based on the above embodiment, the animal carcass body size measuring device may further include:

[0113] An upper left corner coordinate value acquisition module, used for acquiring the coordinate value of the upper left corner of each thoracic half-section carcass detection frame if there are multiple thoracic half-section carcass detection frames;

[0114] The detection frame sorting module is used to sort the chest cavity half-carcass detection frames from large to small according to the coordinate value of the upper left corner.

[0115] Based on any of the above embodiments, the animal carcass body size measuring device may further include:

[0116] A number acquisition module, used for inputting the thoracic half-carcass detection frame into the target tracking model to obtain the number of the thoracic half-carcass detection frame;

[0117] Accordingly, the body size calculation module 500 may specifically include:

[0118] A number storage unit, used to sequentially store the spatial coordinates of the key points in the data set corresponding to the number;

[0119] The body size calculation unit is used to calculate the body size based on all data in the current data set when no new spatial coordinates are stored within a preset time period.

[0120] Based on the above embodiment, the number acquisition module may include:

[0121] An input unit, used for inputting the thoracic half-carcass detection frame into the target tracking model and outputting a result;

[0122] A first allocation unit, configured to allocate a new number to the thoracic half-carcass detection frame if the result is empty;

[0123] The second allocation unit is used to determine the serial number corresponding to the thoracic half-carcass detection frame by using a matching algorithm if the result is not empty.

[0124] Based on the above embodiment, the key point detection module 300 may include:

[0125] A detection unit, used for inputting the target image into a key point detection model to obtain the key point coordinates; the key points include the midpoint of the front edge of the pubic symphysis, the midpoint of the front edge of the first cervical vertebra, the intersection of the first rib and the sternum, and the midpoint of the distance from the sixth to the seventh rib;

[0126] Accordingly, the body size calculation module 500 may specifically include:

[0127] A straight length calculation unit, used for calculating the straight length of the carcass according to the spatial coordinates of the midpoint of the front edge of the pubic symphysis and the spatial coordinates of the midpoint of the front edge of the first cervical vertebra;

[0128] An oblique length calculation unit, used for calculating the oblique length of the carcass according to the spatial coordinates of the midpoint of the front edge of the pubic symphysis and the spatial coordinates of the intersection of the first rib and the sternum;

[0129] The back fat thickness calculation unit is used to calculate the back fat thickness according to the spatial coordinates of the midpoint of the distance from the sixth to the seventh rib.

[0130] Based on the above embodiment, the backfat thickness calculation unit may specifically include:

[0131] A back fat area image extraction subunit, used for extracting the back fat area image in the target image according to the coordinates of the midpoint of the distance from the sixth to the seventh rib and a preset extraction condition;

[0132] A back fat region mask acquisition subunit, used for inputting the back fat region image into a semantic segmentation model to obtain a back fat region mask;

[0133] A mask coordinate list determination subunit, used to obtain a mask coordinate list according to the back fat area mask, the coordinates of the midpoint of the distance from the sixth to the seventh rib and a preset range interval;

[0134] The spatial coordinate determination subunit is used to calculate the spatial coordinate of the midpoint of the distance from the sixth to the seventh rib according to the mask coordinate list and the depth map.

[0135] It should be noted that the order of the modules and units in the above-mentioned animal carcass body size measuring device can be changed without affecting the logic.

[0136] The animal carcass body size measuring device provided by the embodiment of the present invention is used to obtain the original image of the animal carcass production line through the image acquisition module 100; the original image is composed of a depth map and a color map; the target detection module 200 is used to perform target detection and image extraction on the color map to obtain the target image corresponding to the chest cavity half carcass detection frame; the key point detection module 300 is used to perform key point detection on the target image to obtain the key point coordinates; the key points are used to measure the body size; the mapping module 400 is used to map the key point coordinates to the depth map to obtain the spatial coordinates of the key points; the body size calculation module 500 is used to calculate the body size according to the spatial coordinates of the key points. This device can automatically calculate the body size data of the animal carcass based on deep learning technology, which solves the problems of error, fraud and waste of manpower caused by manual measurement. The body size data obtained by the present invention can trace its paternal and maternal lines, guide breeding, accelerate the optimization iteration of breeding pigs, and realize closed-loop management of the entire process of pigs.

[0137] The following is an introduction to an animal carcass body size measuring device provided by an embodiment of the present invention. The animal carcass body size measuring device described below and the animal carcass body size measuring method described above can refer to each other.

[0138] Please refer to Figure 4 , Figure 4 A schematic structural diagram of an animal carcass body size measuring device provided by an embodiment of the present invention may include:

[0139] A memory 10, used for storing computer programs;

[0140] The processor 20 is used to execute a computer program to implement the above-mentioned method for measuring the body size of an animal carcass.

[0141] The memory 10 , the processor 20 , and the communication interface 31 all communicate with each other via the communication bus 32 .

[0142] In the embodiment of the present invention, the memory 10 is used to store one or more programs, and the program may include program code, and the program code includes computer operation instructions. In the embodiment of the present invention, the memory 10 may store programs for implementing the following functions:

[0143] Acquire an original image of an animal carcass production line; the original image is composed of a depth image and a color image;

[0144] Perform target detection and image extraction on the color image to obtain the target image corresponding to the chest cavity half carcass detection frame;

[0145] Detect key points of the target image and obtain the coordinates of the key points; the key points are used to measure body size;

[0146] Map the key point coordinates to the depth map to obtain the spatial coordinates of the key points;

[0147] The body size is calculated based on the spatial coordinates of the key points.

[0148] In a possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function, etc.; the data storage area may store data created during use.

[0149] In addition, the memory 10 may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include an NVRAM. The memory stores an operating system and operating instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, wherein the operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and processing hardware-based tasks.

[0150] The processor 20 may be a central processing unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array or other programmable logic device, a microprocessor or any conventional processor, etc. The processor 20 may call a program stored in the memory 10 .

[0151] The communication interface 31 may be an interface of a communication module, and is used to connect to other devices or systems.

[0152] Of course, it should be noted that Figure 4 The structure shown does not constitute a limitation on the animal carcass body size measuring device in the embodiment of the present invention. In actual application, the animal carcass body size measuring device may include Figure 4More or fewer components than shown, or combinations of certain components.

[0153] The following is an introduction to a readable storage medium provided in an embodiment of the present invention. The readable storage medium described below and the animal carcass body size measurement method described above can be referenced to each other.

[0154] The present invention also provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned animal carcass body size measurement method are implemented.

[0155] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0156] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0157] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0158] Finally, it should be noted that, in this article, relationships such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes 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.

[0159] The above is a detailed introduction to an animal carcass body size measurement method, device, equipment and readable storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for a person skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A method for measuring the body size of an animal carcass, It is characterized in that include: Get the original image of the animal carcass production line; The original image is composed of a depth map and a color map; Performing target detection and image extraction on the color image to obtain a target image corresponding to a chest cavity half-carcass detection frame; Performing key point detection on the target image to obtain key point coordinates; the key points are used to measure body size; Mapping the key point coordinates onto the depth map to obtain the spatial coordinates of the key points; The body size is calculated according to the spatial coordinates of the key points.

2. The method for measuring the body size of an animal carcass according to claim 1, It is characterized in that Performing target detection and image extraction on the color image to obtain a target image corresponding to a chest cavity half carcass detection frame includes: Inputting the color image into a target detection model to obtain a plurality of animal carcass detection frames; The plurality of animal carcass detection frames are screened according to preset label values, and the detection frame of the thorax of the half-carcass is used as the thorax half-carcass detection frame; The image corresponding to the thoracic half-carcass detection frame in the color image is extracted as the target image.

3. The method for measuring the body size of an animal carcass according to claim 2, It is characterized in that After the detection frame of the thorax of the half-carcass is used as the thorax half-carcass detection frame, the method further includes: If there are multiple thoracic half-section carcass detection frames, then obtaining the coordinate value of the upper left corner of each thoracic half-section carcass detection frame; According to the coordinate value of the upper left corner, each thoracic half-section carcass detection frame is sorted from large to small.

4. The method for measuring the body size of an animal carcass according to any one of claims 1 to 3, It is characterized in that After performing target detection and image extraction on the color image to obtain a target image corresponding to a chest cavity half carcass detection frame, the method further includes: Inputting the thoracic half-carcass detection frame into a target tracking model to obtain a serial number of the thoracic half-carcass detection frame; Accordingly, the body size is calculated according to the spatial coordinates of the key points, including: The spatial coordinates of the key points are sequentially stored in the data sets corresponding to the numbers; When no new spatial coordinates are stored within a preset time period, the body size is calculated based on all data in the current data set.

5. The method for measuring the body size of an animal carcass according to claim 4, It is characterized in that Inputting the thoracic half-carcass detection frame into the target tracking model to obtain the serial number of the thoracic half-carcass detection frame includes: Inputting the thoracic half-carcass detection frame into the target tracking model and outputting the result; If the result is empty, a new number is assigned to the thoracic half-carcass detection frame; If the result is not empty, a matching algorithm is used to determine the serial number corresponding to the thoracic half-carcass detection frame.

6. The method for measuring the body size of an animal carcass according to claim 1, It is characterized in that The step of performing key point detection on the target image to obtain key point coordinates includes: Input the target image into the key point detection model to obtain the key point coordinates; the key points include the midpoint of the front edge of the pubic symphysis, the midpoint of the front edge of the first cervical vertebra, the intersection of the first rib and the sternum, and the midpoint of the distance from the sixth to the seventh rib; Accordingly, the body size is calculated according to the spatial coordinates of the key points, including: The straight length of the carcass is calculated based on the spatial coordinates of the midpoint of the front edge of the pubic symphysis and the midpoint of the front edge of the first cervical vertebra; The oblique length of the carcass is calculated based on the spatial coordinates of the midpoint of the front edge of the pubic symphysis and the spatial coordinates of the intersection of the first rib and the sternum; The back fat thickness was calculated based on the spatial coordinates of the midpoint between the sixth and seventh ribs.

7. The method for measuring the body size of an animal carcass according to claim 6, It is characterized in that Mapping the coordinates of the midpoint of the distance between the sixth and seventh ribs to the depth map to obtain the spatial coordinates of the midpoint of the distance between the sixth and seventh ribs includes: Extracting a back fat region image in the target image according to the coordinates of the midpoint of the distance from the sixth to the seventh rib and a preset extraction condition; Inputting the back fat region image into a semantic segmentation model to obtain a back fat region mask; Obtaining a mask coordinate list according to the back fat area mask, the coordinates of the midpoint of the distance from the sixth to the seventh rib, and a preset range interval; The spatial coordinates of the midpoint of the distance from the sixth to the seventh rib are calculated according to the mask coordinate list and the depth map.

8. A device for measuring the body size of an animal carcass, It is characterized in that include: An image acquisition module, used to acquire original images of the animal carcass production line; The original image is composed of a depth map and a color map; A target detection module, used for performing target detection and image extraction on the color image to obtain a target image corresponding to a detection frame of the thoracic half-carcass; A key point detection module, used to detect key points of the target image to obtain key point coordinates; the key points are used to measure body size; A mapping module, used to map the key point coordinates to the depth map to obtain the spatial coordinates of the key points; The body size calculation module is used to calculate the body size according to the spatial coordinates of the key points.

9. An animal carcass size measuring device, It is characterized in that include: Memory for storing computer programs; A processor, configured to implement the steps of the animal carcass body size measurement method according to any one of claims 1 to 7 when executing the computer program.

10. A readable storage medium, It is characterized in that The readable storage medium stores computer executable instructions, and when the computer executable instructions are loaded and executed by the processor, the steps of the animal carcass body size measurement method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Non-contact pig body size estimation method and device based on multi-position camera

    CN119672088A