A method for measuring pig carcass fat thickness and related products
Through image recognition technology and pixel-level solution, the problems of artificial error and complex operation in pig carcass fat thickness measurement are solved, and fast, accurate and high-precision contactless measurement is achieved, which is suitable for slaughterhouse production lines.
Patent Information
- Application Number
- CN202210376515.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-11
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-04-11
AI Technical Summary
The prior art has problems such as large manual error, high cost, low efficiency, complex operation and low accuracy in measuring pig carcass fat thickness, making it difficult to achieve fast, accurate and large-scale fat thickness measurement.
Image recognition technology determines the measurement positioning point in the pig carcass, extracts the fat thickness measurement area, and uses image pixel-level solution to calculate the fat thickness to achieve contactless, fast and accurate fat thickness measurement.
It realizes high-precision, contactless, high-speed, and real-time measurement of pig carcass fat thickness, reduces labor costs, improves the robustness and flexibility of measurement, and is suitable for slaughterhouse production lines.
Smart Images

Figure CN114708233B_ABST
Abstract
Description
Technical Field
[0001] The present invention generally relates to the field of non-contact measurement, machine vision and image processing technology. More specifically, the present invention relates to a method for measuring fat thickness of pig carcasses and related products. Background Art
[0002] Fat thickness has always been an important indicator for the production of lean meat, fat meat and fresh pork. With the improvement of people's lives in my country, in order to provide an appropriate proportion of lean meat and fat meat to meet people's needs, the breeding and purchasing departments need to accurately measure the fat development and thickness parameters of pigs, so as to take corresponding breeding measures and product grading plans in a planned manner and achieve strict guarantee of pork quality.
[0003] In the livestock slaughtering industry, back fat thickness is an important parameter indicator for assessing pork grade. It is a parameter that enterprises must measure during the production process, and it can directly reflect the grade of pig carcasses. In the industry, the back fat thickness corresponding to fresh and frozen pork slices from slaughtered and processed pigs is mainly based on the thickness of the fat layer (back fat thickness) after removing the skin, from the middle of the sixth and seventh ribs of fresh pork slices parallel to the front and lower part of the sixth thoracic spinous process.
[0004] At present, the grading of pig carcasses at home and abroad is mainly carried out by measuring the back thickness of the pork halves.
[0005] Based on this, domestic and foreign slaughtering companies mainly use the following methods to measure the thickness of pig carcass back fat:
[0006] The first is manual measurement. The thickness of back fat is measured manually with a steel ruler on the production line. Specifically, the staff uses a steel ruler to measure and record the thickness of the fat between the sixth and seventh ribs of the fresh pig carcass parallel to the front and lower part of the spinous process of the sixth thoracic vertebra. This method requires the cooperation of three staff members who measure, record and stamp at the same time to complete the carcass grading on the slaughter line. There are problems such as high labor costs, human errors in measurement records, and measurement deviations among different measurement personnel. Therefore, the manual measurement method currently used has large subjective errors, high labor costs, and low efficiency, making it difficult to achieve standardized and intelligent grading.
[0007] The second method is ultrasonic measurement. The location of the interfat fascia is automatically identified based on the ripple characteristics of the ultrasonic echo, and then the thickness of the pig back fat is calculated based on the imaging results. This measurement method requires the ultrasonic probe to be in direct contact with the back fat and the ultrasonic coupling agent to be applied. It has the disadvantage of being difficult to operate and is difficult to promote and apply on a large scale.
[0008] The third method is photoelectric probe measurement. The probe is inserted into the pig carcass to detect the thickness of the pig carcass back fat. This method requires the staff to constantly pull out and insert the probe. Due to the elastic properties of pork itself, the pig carcass will produce a certain amount of deformation during the process of pulling out and inserting the probe, thereby changing the size of the detected parameters, resulting in a serious decrease in data accuracy; at the same time, the detection efficiency is relatively low and other disadvantages.
[0009] The fourth type is machine vision technology measurement. At present, the engineering application of machine vision technology to measure fat thickness in the slaughtering industry is mainly based on theoretical research. By shooting the back fat image of the measuring point on one side after splitting in half, the target pixel features of the whole rib are obtained by combining image recognition technology to extract gray lines, clustering and other methods, and then mapped to the back fat part to be measured for calculation, or the corresponding fat thickness measurement position information is located by the prior carcass batch length and measurement position ratio relationship; the whole rib measurement feature extraction and back fat measurement method ideas in this type of scheme are very reference for engineering applications; however, the complexity of the application scenario makes the whole rib feature extraction less stable, and the floating error of fat thickness measurement based on the carcass length and measurement position ratio relationship is large, which needs to be improved and promoted in the actual large-scale application of slaughterhouse production.
[0010] Among the above centralized measurement methods, although the manual measurement method is currently the most direct and widely used method, this method has the disadvantages of large human errors and high labor costs. The ultrasonic model fat thickness measurement method requires more complicated operations, and improper operation will result in large measurement errors. Therefore, it requires professional people to operate and is not suitable for large-scale applications in the pig slaughtering industry. Photoelectric probe technology is prone to deformation of pig carcasses, has large uncertainty, and accuracy cannot be guaranteed. The current machine vision-based fat thickness measurement solutions all use traditional image processing solutions, which are too dependent on empirical values such as carcass batches and lengths, fixed light scenes, and pig carcasses that do not change much. The robustness of the algorithm is poor and does not meet the standards for large-scale production applications.
[0011] Therefore, how to achieve fast and accurate measurement of pig carcass fat thickness plays an important role in promoting the improvement of the pig carcass grading system, improving the quality of pig carcasses in my country, and promoting the development of my country's pork industry. Summary of the invention
[0012] In order to solve one or more of the above technical problems, the present invention proposes a method for quickly finding the measurement positioning points in the pig carcass image by using image recognition technology, and accurately segmenting the fat thickness area in the pig carcass according to the measurement positioning points for detection and calculation, thereby realizing fast, accurate, non-contact and on-line measurement of the fat thickness of the pig carcass. To this end, the present invention provides solutions in the following aspects.
[0013] In a first aspect, the present invention provides a method for measuring the fat thickness of a pig carcass, comprising: acquiring a pig carcass image; inputting the pig carcass image into an image recognition model for recognition to determine measurement positioning points, wherein the measurement positioning points include ribs in the pig carcass; extracting a fat thickness measurement area from the pig carcass image according to the measurement positioning points; and calculating the pig fat in the fat thickness measurement area using an image pixel-level solution to obtain the thickness of the pig fat.
[0014] In one embodiment, the step of inputting the pig carcass image into an image recognition model for identification to determine the measurement positioning point comprises: inputting the pig carcass image into an image recognition model to obtain a recognition result, wherein the recognition result comprises a relative error between a priori positioning point and a measurement positioning point; determining the position information of the measurement positioning point based on the recognition result, wherein the priori positioning point is an empirical value of the positioning point.
[0015] In one embodiment, the positioning point is the 6th and 7th ribs in the pig's abdomen.
[0016] In one embodiment, extracting the fat thickness measurement area from the pig carcass image according to the measurement positioning point includes: offsetting the set pixel values upward and downward respectively with the measurement positioning point as the center, and intercepting the pig carcass image to obtain the fat thickness measurement area.
[0017] In one embodiment, the method of calculating the pig fat in the fat thickness measurement area by using image pixel level solution to obtain the thickness of the pig fat includes: determining the pig fat in the fat thickness measurement area according to image pixel level solution; sampling the pig fat in the fat thickness measurement area to calculate the thickness of the pig fat according to the sampling result.
[0018] In one embodiment, determining the pig fat in the fat thickness measurement area according to the image pixel level solution includes: performing grayscale processing and binarization processing on the fat thickness measurement area to obtain the pig fat in the binary image.
[0019] In one embodiment, sampling the pig fat in the fat thickness measurement area to calculate the thickness of the pig fat according to the sampling results includes: performing interval sampling of a closed area in the width direction of the binary image to obtain a sampling result; and calculating the sampling result according to a weighted average algorithm to obtain the thickness of the pig fat.
[0020] In one embodiment, the method further includes: detecting the boundary of the pork fat to determine whether cartilage or red meat exists at the boundary; and compensating for the thickness of the pork fat in response to the presence of cartilage or red meat at the boundary of the pork fat.
[0021] In a second aspect, the present invention further provides a device for measuring the fat thickness of pig carcasses, comprising: an industrial camera, a processor, and a memory, wherein the industrial camera is used to collect original carcass image data containing a fat thickness area to be detected; and the memory is used to store computer-executable instructions, and when the instructions are executed by the processor, the method described in the multiple embodiments of the first aspect is implemented.
[0022] In a third aspect, the present invention further provides a computer-readable storage medium storing program instructions for measuring fat thickness of pig carcasses. When the program instructions are executed by a processor, the method according to the multiple embodiments of the first aspect is implemented.
[0023] Through the scheme of the present invention, the fat thickness measurement area can be quickly and accurately located according to the image recognition technology, and then the actual fat thickness value of the carcass can be obtained by using the image processing technology. Compared with the manual measurement method, the ultrasonic measurement method and the photoelectric probe technology measurement method, non-contact, high-speed, high-precision, on-line and real-time size measurement of the pig carcass can be achieved. Compared with the existing traditional machine vision measurement scheme, the method of the present invention does not rely on carcass batches, lengths, etc., and has higher robustness. Furthermore, the measurement method of this scheme can be used in the actual production line of a slaughterhouse, and has the advantage of high measurement flexibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0025] Figure 1 is a schematic diagram schematically illustrating a scenario of measuring pig carcass fat thickness according to an embodiment of the present invention;
[0026] Figure 2 is a schematic diagram schematically illustrating a method for measuring fat thickness of a pig carcass according to an embodiment of the present invention;
[0027] Figure 3 is a schematic diagram schematically illustrating a method for measuring fat thickness of a pig carcass according to an embodiment of the present invention;
[0028] Figure 4 is a schematic diagram schematically illustrating a fat thickness measurement area extracted according to an embodiment of the present invention;
[0029] Figure 5 is a schematic diagram schematically showing a binary image of a fat thickness measurement area according to an embodiment of the present invention;
[0030] Figure 6 is a schematic diagram schematically illustrating interval sampling of pig fat in a fat thickness measurement area according to an embodiment of the present invention;
[0031] Figure 7 is a schematic diagram schematically illustrating a method for compensating for a sampling error according to an embodiment of the present invention;
[0032] Figure 8 The diagram schematically shows a device for measuring fat thickness of pig carcasses according to an embodiment of the present invention. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0034] It should be understood that the terms "first", "second", "third" and "fourth" etc. in the claims, specifications and drawings of the present invention are used to distinguish different objects rather than to describe a specific order. The terms "include" and "comprise" used in the specification and claims of the present invention indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections.
[0035] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the claims, the singular forms of "a", "an" and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in the specification of the present invention and the claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0036] As used in this specification and claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0037] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0038] Figure 1 is a schematic diagram schematically illustrating a scenario 100 of measuring fat thickness of a pig carcass according to an embodiment of the present invention.
[0039] like Figure 1 As shown, according to the solution of the present invention, the sensing device 12 can be used to capture images of the pig carcass 11. In some embodiments, the sensing device 12 may include a camera and / or a video camera. The sensing device 12 can be used to capture multiple clear backfat images that include the detection area. The backfat image includes a chest image of at least 7 ribs from front to back. In order to ensure measurement accuracy, the captured image of the pig carcass is not allowed to have visible ghosting. In an implementation scenario, the sensing device can be fixedly installed in the detection area, such as on the ground of a pig carcass processing production line, and fixed by bolts. After the sensing device is installed, a standard block can be used for calibration to obtain the proportional relationship between the actual physical size and the image pixels.
[0040] After the image of the pig carcass is acquired by using the sensing device, the image of the pig carcass is sent to the information processing center 13 of the present invention. In some embodiments, the information processing center 13 here can be implemented as a computing unit or module, and is used to perform information processing (including various data fusion operations) and optionally perform master control operations on various interconnected devices. In operation, the information processing center 13 can extract the fat thickness measurement area based on the image of the pig carcass, and calculate the pig fat in the fat thickness measurement area using a visual algorithm model and image pixel-level solution to obtain the thickness of the pig fat. Therefore, the scheme of the present invention provides a reliable way to quickly and accurately measure the thickness of the pig fat.
[0041] Combination of the above Figure 1 The scheme of the present invention has been described. It can be understood that the above description is only exemplary and not restrictive. Those skilled in the art can Figure 1 The scene shown in the figure can be changed without departing from the spirit and essence of the present invention. For example, the sensing device is arranged above the pork product production line.
[0042] Figure 2 2 is a schematic diagram schematically illustrating a method 200 for measuring fat thickness of a pig carcass according to an embodiment of the present invention. It can be understood that Figure 2 The method flow shown in Figure 1 , so regarding Figure 1 The same applies to the description (e.g. about sensing devices) Figure 2 .
[0043] like Figure 2 As shown, at step S201, a pig carcass image is obtained. As mentioned above, when the sensing device is a camera or a video camera, its sensing information can be an image or video of a pig carcass.
[0044] Next, at step S202, the pig carcass image is input into the image recognition model for recognition to determine the measurement positioning point. The measurement positioning point may include the ribs in the pig carcass. Figure 1 As shown, the recognition action can be performed, for example, by Figure 1 It is executed by the information processing center shown in .
[0045] After determining the measurement positioning points using the image of the pig carcass, at step S203, the fat thickness measurement area is extracted from the pig carcass image according to the measurement positioning points. In some embodiments, the extraction process can obtain an area in the image suitable for detecting fat thickness, thereby improving the convenience and accuracy of detection.
[0046] Finally, at step S204, the fat in the fat thickness measurement area is calculated using the image pixel level solution to obtain the thickness of the fat. In some embodiments, the pig carcass image can be grayed and binarized using the image pixel level solution so that the image can clearly show the fat.
[0047] Figure 3 3 is a schematic diagram schematically illustrating a method 300 for measuring fat thickness of a pig carcass according to an embodiment of the present invention. It can be understood that Figure 3 The solution shown in the process can be Figure 2 A possible implementation of method steps S202 to S204, therefore, regarding Figure 2 The description of the method in this section also applies to the following description of Figure 3 Description.
[0048] like Figure 3 As shown, at step S301, the pig carcass image is input into an image recognition model to obtain a recognition result, wherein the recognition result includes a relative error between a priori positioning points and a measured positioning point.
[0049] At step S302, the position information of the measurement positioning point is determined according to the recognition result, and the prior positioning point is the empirical value of the positioning point. In some embodiments, the positioning point can be the 6th and 7th ribs in the pig's abdomen. It can be understood that the positioning point of the present invention using the 6th and 7th ribs in the pig's abdomen is only schematic and not restrictive. Those skilled in the art can also select other positioning points according to actual needs to measure the fat thickness of other parts. For example, the positioning point can also be the thickest part of the shoulder, the last rib, and the midpoint of the buttocks semilunar muscle. Based on this positioning point, the fat thickness at the thickest part of the shoulder, the fat thickness at the last rib, and the fat thickness at the midpoint of the buttocks semilunar muscle can be measured.
[0050] In step S303, the measurement positioning point is used as the center, and the set pixel values are offset upward and downward respectively, and the pig carcass image is intercepted to obtain the fat thickness measurement area. In this way, the pig fat can be clearly displayed, and the appropriate area can be intercepted for fat thickness detection.
[0051] At step S304, the fat in the fat thickness measurement area is determined based on the image pixel level solution. In some embodiments, the fat thickness measurement area can be grayed and binarized to obtain the fat in the binarized image.
[0052] At step S305, the fat in the fat thickness measurement area is sampled to calculate the thickness of the fat according to the sampling results. In an application scenario, the sampling results can be obtained by performing interval sampling of a closed area in the width direction of a binary image containing the fat. Then, the sampling results are calculated according to a weighted average algorithm to obtain the thickness of the fat, thereby achieving a pixel-level solution for the fat in the fat thickness measurement area.
[0053] Furthermore, the present invention can also compensate for the detected fat thickness to improve the accuracy of fat thickness measurement. At step S306, the fat boundary is detected to determine whether cartilage or red meat exists at the boundary. At step S307, in response to the presence of cartilage or red meat at the fat boundary, the fat thickness is compensated.
[0054] The following will be combined Figures 4 to 7 The fat thickness measurement process of the solution of the present invention is described in detail. Figure 4 is a schematic diagram schematically illustrating an extracted fat thickness measurement area according to an embodiment of the present invention. Figure 5 FIG. 4 is a schematic diagram schematically showing a binarized image of a fat thickness measurement area according to an embodiment of the present invention. Figure 6 FIG. 4 is a schematic diagram schematically illustrating interval sampling of pig fat in a fat thickness measurement area according to an embodiment of the present invention. Figure 7 is a schematic diagram schematically illustrating a method for compensating for a sampling error according to an embodiment of the present invention.
[0055] First, the image recognition model based on the deep convolutional neural network and the fully connected network can predict the position of the 6th and 7th ribs in the image of the pig carcass, that is, the measurement positioning point. In order to improve the prediction accuracy of the neural network, the output result of this part of the model can be the relative error between the prior positioning point and the actual positioning point, and the error value is used to obtain the accurate pixel coordinates of the measurement positioning point through the decoding network. The determination of the position of the prior positioning point can be obtained based on a large number of statistical results of the positions of the 6th and 7th ribs of the pig after splitting in half. The relative error between the prior positioning point and the actual positioning point includes the height deviation and angle deviation between the two. The decoding network is a calculation process that combines the coordinate value and angle value of the prior positioning point with the error value predicted by the neural network to obtain the final measurement positioning point coordinates.
[0056] Next, in the collected pig carcass images, the images within the set pixel range above and below the measurement positioning point are selected to separate the pig fat from other parts, so as to facilitate the information processing center to measure the thickness of the pig back fat. Specifically, the sampled pig carcass image can be cropped, the cropping width includes the entire pig carcass, and the cropping height is offset by a fixed empirical pixel value above and below the measurement positioning point, such as Figure 4 The image of the thickness detection area is shown in FIG. The fat and other parts can be distinguished in the extracted fat thickness measurement area.
[0057] Then, in the extracted fat thickness measurement area, the fat thickness data can be obtained by weighted averaging. Specifically, the fat thickness measurement area can be grayed, interference removed, closed area width interval sampling can be performed, and the top N width data with the highest frequency can be adaptively selected based on the variance to calculate the final back fat thickness by weighted averaging. Figure 5 The grayscale and binarized image of the fat thickness measurement area is shown in FIG. Figure 5 The pixels in the white area shown in the figure are counted to achieve the measurement of fat thickness.
[0058] The closed area width interval sampling refers to cutting the pig fat after binarization and removing interference into the shape of a zebra crossing, and counting the length data of each small rectangular strip. Figure 6 The effect of the fat measurement area after sampling at intervals using the closed area width is shown in FIG. This is achieved by traversing the binary fat thickness detection area and assigning three consecutive rows of pixel values to zero every three rows of pixels in the Y-axis direction of the pixel coordinate.
[0059] Next, according to the data distribution variance obtained by interval sampling, the corresponding regression network is designed to return the optimal number of data that needs to be included in the weighted average. The specific implementation of the regression network can use a BP neural network to map the data variance value to the number of data that needs to be included in the weighted average. In the scheme of the present invention, weighted average is a data processing method that can avoid the influence of erroneous data as much as possible. Specifically, it refers to the selected width data that needs to be included in the weighted average. The frequency of its occurrence is used as the weight to obtain the final calculation result, thereby achieving the image pixel level solution of the pig fat in the fat thickness measurement area. The following formula (1) illustrates the process of calculating the corresponding fat thickness using the weighted average calculation method.
[0060]
[0061] In formula (1), n is the number of occurrences of each width data, and r is the width data under the weight. i = 1-F, where F is the optimal number of data that needs to be included in the weighted average obtained by the regression network according to the variance of the data distribution.
[0062] Furthermore, after the fat thickness data is calculated using the above method, the interference caused by the back fat thickness measurement can be compensated to improve the measurement accuracy. The error sources mainly include meat pressing fat, resulting in a low result, and the unclear boundary between fat and bone, resulting in part of the cartilage being divided into fat, which causes the final result to be high. Figure 7 As shown in the figure, when performing error compensation, the left and right boundaries of fat can be obtained first, and 20 10×10 pixel rectangular blocks are uniformly sampled on the left and right sides of the right boundary line. Each rectangular block uses a classification recognition algorithm (a classification algorithm based on a residual convolutional neural network) to determine whether it is red meat. Once more than 10 rectangular blocks are judged to be red meat, it is determined that the meat is seriously fat, and a positive error compensation amount is added to the final result. Similarly, when more than five rectangular block sampling areas are found on the left side of the boundary line and are judged to be cartilage by the classification network, a negative error compensation amount is added to the final result.
[0063] It should be noted that the selection of the number of rectangular blocks in the above error compensation determination is illustrative and not restrictive, and those skilled in the art can set it according to actual needs. For example, circular pixel blocks can be sampled, or a larger number of rectangular blocks can be sampled.
[0064] The present invention can realize unmanned fat thickness measurement based on visual algorithm combined with appropriate image acquisition and analysis methods. In practical application, a single slaughtering line can save 2 to 3 workers. After actual testing of tens of thousands of sets of data on the production line, the overall measurement accuracy and stability of the algorithm are high. The test data show that the average accuracy is higher than the manual measurement accuracy, which can meet the measurement needs of pig back fat in production.
[0065] Figure 8 800 is a schematic block diagram of a device 800 for measuring fat thickness of pig carcasses according to an embodiment of the present invention. The device 800 may include a device 801 according to an embodiment of the present invention and its peripheral devices and external network. The device 801 implements operations such as image recognition, image extraction and analysis to achieve the aforementioned combination Figures 1 to 3 The scheme of the present invention.
[0066] like Figure 8 As shown in , the device 801 may include a CPU 8011, which may be a general-purpose CPU, a dedicated CPU, or other information processing and program execution unit. Further, the device 801 may also include a large-capacity memory 8012 and a read-only memory ROM 8013, wherein the large-capacity memory 8012 may be configured to be used for encrypting various programs of plain text data, and the ROM 8013 may be configured to store the power-on self-test of the device 801, the initialization of each functional module in the system, the basic input / output driver of the system, and the data required for booting the operating system.
[0067] Further, the device 801 also includes other hardware platforms or components, such as the TPU (Tensor Processing Unit) 8014, GPU (Graphic Processing Unit) 8015, FPGA (Field Programmable Gate Array) 8016 and MLU (Memory Logic Unit) 8017 shown. It is understood that although a variety of hardware platforms or components are shown in the device 801, this is merely exemplary and not restrictive, and those skilled in the art can add or remove corresponding hardware according to actual needs. For example, the device 801 may include only a CPU as a known hardware platform and another hardware platform as a test hardware platform of the present invention.
[0068] The device 801 of the present invention also includes a communication interface 8018, so that it can be connected to a local area network / wireless local area network (LAN / WLAN) 805 through the communication interface 8018, and then connected to a local server 806 or to the Internet ("Internet") 807 through the LAN / WLAN. Alternatively or additionally, the device 801 of the present invention can also be directly connected to the Internet or a cellular network through the communication interface 8018 based on wireless communication technology, such as wireless communication technology based on the third generation ("3G"), the fourth generation ("4G") or the fifth generation ("5G") . In some application scenarios, the device 801 of the present invention can also access a server 808 of an external network and a possible database 809 as needed.
[0069] The peripheral devices of the device 801 may include a display device 802, an input device 803, and a data transmission interface 804. In one embodiment, the display device 802 may include, for example, one or more speakers and / or one or more visual displays. The input device 803 may include, for example, a keyboard, a mouse, a microphone, a gesture capture camera, or other input buttons or controls, which are configured to receive input or user instructions for data. The data transmission interface 804 may include, for example, a serial interface, a parallel interface, or a universal serial bus interface ("USB"), a small computer system interface ("SCSI"), a serial ATA, a FireWire ("FireWire"), a PCI Express, and a high-definition multimedia interface ("HDMI"), etc., which are configured for data transmission and interaction with other devices or systems.
[0070] The CPU 8011, the mass storage 8012, the read-only memory ROM 8013, the TPU 8014, the GPU 8015, the FPGA 8016, the MLU 8017 and the communication interface 8018 of the device 801 of the present invention can be connected to each other through a bus 8019, and data interaction with peripheral devices can be achieved through the bus. In one embodiment, through the bus 8019, the CPU 8011 can control other hardware components in the device 801 and its peripheral devices.
[0071] During operation, the processor CPU 8011 of the device 801 of the present invention can obtain plain text data through the input device 803 or the data transmission interface 804, and call the computer program instructions or codes stored in the memory 8012 for data processing to complete the process of measuring the fat thickness of the pig carcass.
[0072] It can be seen from the above description of the modular design of the present invention that the system of the present invention can be flexibly arranged according to the application scenario or demand without being limited to the architecture shown in the accompanying drawings. Further, it should also be understood that any module, unit, component, server, computer or device that performs the operation of the example of the present invention may include or otherwise access a computer-readable medium, such as a storage medium, a computer storage medium or a data storage device (removable) and / or non-removable) such as a disk, an optical disk or a tape. Computer storage media may include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules or other data. Based on this, the present invention also discloses a computer-readable storage medium on which computer-readable instructions for measuring the fat thickness of a pig carcass are stored, and when the computer-readable instructions are executed by one or more processors, the method and operation described in conjunction with the accompanying drawings are implemented.
[0073] Although this specification has shown and described a plurality of embodiments of the present invention, it is obvious to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will appreciate many changes, modifications and alternatives without departing from the thought and spirit of the present invention. It should be understood that in the process of practicing the present invention, various alternatives to the embodiments of the present invention described herein may be adopted. The attached claims are intended to define the scope of protection of the present invention, and therefore cover the modular compositions, equivalents or alternatives within the scope of these claims.
Claims
1. A method for measuring the fat thickness of pig carcasses, It is characterized in that include: Obtain pig carcass images; Inputting the pig carcass image into an image recognition model for recognition to determine measurement positioning points, wherein the measurement positioning points include ribs in the pig carcass; Extracting fat thickness measurement area from pig carcass image according to measurement positioning points; as well as The fat in the fat thickness measurement area is calculated by using the image pixel level solution to obtain the thickness of the fat; The step of inputting the pig carcass image into an image recognition model for recognition to determine the measurement positioning point comprises: Inputting the pig carcass image into an image recognition model to obtain a recognition result, wherein the recognition result includes a relative error between a priori positioning points and a measured positioning point; Determine the position information of the measurement positioning point according to the recognition result, wherein the priori positioning point is an empirical value of the positioning point; The step of extracting the fat thickness measurement area from the pig carcass image according to the measurement positioning point comprises: Taking the measurement positioning point as the center, the set pixel values are offset upward and downward respectively, and the pig carcass image is intercepted to obtain a fat thickness measurement area; Wherein, determining the position information of the measuring point according to the recognition result includes: obtaining accurate pixel coordinates of the measuring positioning point through a decoding network for the relative error; The relative error between the prior positioning point and the measured positioning point includes the height deviation and angle deviation between the two; the decoding network is a calculation process that combines the coordinate value and angle value of the prior positioning point with the error value predicted by the neural network to obtain the final measured positioning point coordinates.
2. The method according to claim 1, It is characterized in that The positioning points are the 6th and 7th ribs in the pig's abdomen.
3. The method according to claim 1, It is characterized in that The method of calculating the pig fat in the fat thickness measurement area by using the image pixel level solution to obtain the thickness of the pig fat includes: Determining the pig fat in the fat thickness measurement area according to the image pixel level solution; The pig fat in the fat thickness measurement area is sampled to calculate the thickness of the pig fat according to the sampling result.
4. The method according to claim 3, It is characterized in that The method of determining the pig fat in the fat thickness measurement area according to the image pixel level solution comprises: The fat thickness measurement area is subjected to grayscale processing and binarization processing to obtain the pig fat in a binarized image.
5. The method according to claim 4, It is characterized in that The step of sampling the pig fat in the fat thickness measurement area to calculate the thickness of the pig fat according to the sampling result comprises: By performing interval sampling of closed areas in the width direction of the binary image, a sampling result is obtained; The sampling results are calculated according to a weighted average algorithm to obtain the thickness of the pig fat.
6. The method according to claim 1, It is characterized in that The method further comprises: Detecting the boundary of the pork fat to determine whether cartilage or red meat exists at the boundary; When there is cartilage or red meat at the border of the fat, the thickness of the fat is compensated.
7. A device for measuring the fat thickness of pig carcasses, It is characterized in that include: processor; and a memory for storing computer-executable instructions, which, when executed by the processor, implement the method according to any one of claims 1-6.
8. A computer-readable storage medium, It is characterized in that It stores program instructions for measuring the fat thickness of pig carcasses. When the program instructions are executed by a processor, the method according to any one of claims 1-6 is implemented.
