Meat marbling evaluation method, device and equipment and storage medium
The parameters of meat marble patterns are extracted through video image processing technology, and the evaluation index vector is calculated to achieve objective evaluation of meat marble patterns, solving the problems of low efficiency and high subjectivity of manual evaluation, and improving the accuracy and efficiency of evaluation.
Patent Information
- Application Number
- CN202411675382.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-04-15
AI Technical Summary
The existing manual evaluation of meat marble patterns has high labor costs and low evaluation efficiency. The results are easily affected by subjectivity and arbitrary, and lack objective data support.
By collecting video images of meat, the pattern parameters of marble patterns are extracted, including pattern area, perimeter and quantity, the evaluation index vector is calculated, and objective evaluation is carried out based on the vector to determine the evaluation level.
It reduces labor cost investment, improves evaluation efficiency, avoids subjectivity and arbitrary influence, and improves the accuracy and authority of evaluation results.
Smart Images

Figure CN119827483A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of food detection, and in particular to a meat marbling evaluation method, device, equipment and storage medium. Background Art
[0002] The evaluation of intramuscular fat in meat is mainly used to evaluate the marbling of livestock meat such as beef or pork. The evaluation of intramuscular fat in meat is not only the main criterion for meat quality grading, but also an important basis for pricing livestock meat products. At present, the evaluation of marbling grade is mainly through text description, and the grading standard is mainly based on the grading evaluation atlas, and the evaluators are trained for a long time. The manual evaluation method is adopted, and the evaluators evaluate the marbling of meat according to the meat grading evaluation atlas and prior knowledge. The labor cost required is high but the evaluation efficiency is low. At the same time, the evaluation results are easily affected by the subjectivity and arbitrariness of the evaluators, and the accuracy and authority are biased to a certain extent, lacking the support of objective data. Summary of the invention
[0003] The present invention provides a meat marbling evaluation method, device, equipment and storage medium, which are used to solve the defects of the existing manual evaluation method of evaluating meat marbling, such as high labor cost, low evaluation efficiency, and the evaluation results are easily affected by the subjectivity and arbitrariness of the evaluators, and the accuracy and authority lack objective data support.
[0004] The present invention provides a method for evaluating meat marbling, comprising the following steps: Collecting a video image of the meat to be evaluated, and extracting pattern parameters of the marble pattern of the meat to be evaluated based on the video image; the pattern parameters include the pattern area, pattern perimeter and pattern quantity of the marble pattern; Determining the index values of the evaluation indexes corresponding to the meat product to be evaluated according to the pattern parameters, and obtaining the evaluation index vector of the meat product to be evaluated; Evaluate the marbling of the meat to be evaluated based on the evaluation index vector, and determine the evaluation grade corresponding to the meat to be evaluated; The step of evaluating the marbling of the meat to be evaluated based on the evaluation index vector and determining the evaluation grade corresponding to the meat to be evaluated includes: Matching the evaluation index vector with an evaluation standard array to determine a target standard vector that matches the evaluation index vector; Determining the evaluation level corresponding to the meat product to be evaluated according to the evaluation level corresponding to the target standard vector; Among them, the evaluation standard array is constructed based on the evaluation standard vector corresponding to each evaluation level, and the evaluation standard vector is composed of the standard index value of the evaluation index corresponding to each evaluation level, and the standard index value is calculated based on the pattern parameters extracted from the standard image of meat corresponding to each evaluation level.
[0005] According to the meat marbling evaluation method provided by the present invention, the step of extracting the marbling pattern parameters of the meat to be evaluated based on the video image comprises: Extracting a target frame image from the video image, and performing threshold segmentation processing on the target frame image to obtain a binary template of a target interest area corresponding to the meat product to be evaluated; the target frame image is collected when the meat product to be evaluated is located in a preset detection area; Taking the area as a filtering parameter, after performing morphological filtering on the binary template, performing dot multiplication with the target frame image, a target object image of the meat to be evaluated is obtained; The pattern parameters of the marbling of the meat to be evaluated are extracted based on the target object image.
[0006] According to the meat marbling evaluation method provided by the present invention, the step of extracting the marbling pattern parameters of the meat to be evaluated based on the target object image comprises: Determine the minimum bounding rectangle of the meat to be evaluated based on the binary template, and cut the target image according to the minimum bounding rectangle to obtain an image of the region of interest of the meat to be evaluated; Binarizing the image of the region of interest to obtain a binary image of the region of interest; Performing a dot product on the interest region binary image and the interest region image to obtain a pattern binary image of each marble pattern in the target interest region; Constructing a label matrix of each marble pattern in the target area of interest according to the pattern binary image; the label serial number of the label matrix is used to represent the serial number of each marble pattern in the target area of interest; The pattern parameters of the marbling of the meat to be evaluated are extracted based on the label matrix.
[0007] According to the meat marbling evaluation method provided by the present invention, determining the index values of the evaluation indexes corresponding to the meat to be evaluated according to the pattern parameters to obtain the evaluation index vector of the meat to be evaluated includes: Extracting meat parameters of the meat to be evaluated from the video image; the meat parameters include meat area and meat circumference; Obtaining a conversion coefficient between a pixel area and an actual area, and calculating the index value of each evaluation index corresponding to the meat to be evaluated according to the conversion coefficient, the pattern parameter and the meat parameter, to obtain an evaluation index vector of the meat to be evaluated; The evaluation index includes at least one of pattern area ratio, pattern density, pattern diversity index, pattern uniformity index, pattern separation index, pattern shape index and pattern aggregation index.
[0008] According to the meat marbling evaluation method provided by the present invention, the conversion coefficient between the pixel area and the actual area is obtained, including: Acquire a reference image of a preset reference object; the reference image is acquired by collecting the reference object in a preset detection area, and the actual area of the reference object is a preset standard area; Performing color space conversion on the reference image to obtain a grayscale image; Performing filtering processing on the grayscale image to obtain a filtered image, and determining a segmentation threshold according to a pixel value of each pixel in the filtered image; Performing threshold segmentation on the filtered image based on the segmentation threshold to obtain a foreground binary image of a reference object interest area corresponding to the reference object; Performing morphological filtering on the foreground binary image to obtain a reference binary template; Counting the target number of pixel points corresponding to the reference object in the reference object binary template to obtain the pixel area of the reference object; The ratio of the pixel area of the reference object to the standard area is calculated to obtain a conversion coefficient between the pixel area and the actual area.
[0009] According to the meat marbling evaluation method provided by the present invention, determining the index values of the evaluation indexes corresponding to the meat to be evaluated according to the pattern parameters to obtain the evaluation index vector of the meat to be evaluated includes: Obtaining an evaluation system corresponding to the evaluation standard corresponding to the meat product to be evaluated; Determine each evaluation indicator corresponding to the evaluation system; The index value of each evaluation index is calculated according to the pattern parameters.
[0010] According to the meat marbling evaluation method provided by the present invention, after evaluating the marbling of the meat to be evaluated based on the evaluation index vector and determining the evaluation grade corresponding to the meat to be evaluated, the method further includes: Determine the grade channel corresponding to the evaluation grade of the meat product to be evaluated; The meat products to be evaluated are marked based on the grade channels to sort the meat products to be evaluated into the grade channels.
[0011] The present invention also provides a meat marbling evaluation device, comprising the following modules: A parameter extraction module, used to collect a video image of the meat to be evaluated, and extract pattern parameters of the marble pattern of the meat to be evaluated based on the video image; the pattern parameters include the pattern area, pattern perimeter and pattern quantity of the marble pattern; An index calculation module, used to determine the index value of each evaluation index corresponding to the meat product to be evaluated according to the pattern parameter, and obtain the evaluation index vector of the meat product to be evaluated; A grade evaluation module, used to evaluate the marbling of the meat to be evaluated based on the evaluation index vector, and determine the evaluation grade corresponding to the meat to be evaluated; The grade evaluation module is also used for: Matching the evaluation index vector with an evaluation standard array to determine a target standard vector that matches the evaluation index vector; Determining the evaluation level corresponding to the meat product to be evaluated according to the evaluation level corresponding to the target standard vector; Among them, the evaluation standard array is constructed based on the evaluation standard vector corresponding to each evaluation level, and the evaluation standard vector is composed of the standard index value of the evaluation index corresponding to each evaluation level, and the standard index value is calculated based on the pattern parameters extracted from the standard image of meat corresponding to each evaluation level.
[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the meat marbling evaluation method as described above is implemented.
[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the meat marbling evaluation method as described in any one of the above is implemented.
[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the meat marbling evaluation method as described above is implemented.
[0015] The meat marbling pattern evaluation method, device, equipment and storage medium provided by the present invention collect video images of the meat to be evaluated and extract pattern parameters of the marble pattern of the meat to be evaluated therefrom, thereby determining the index value of the evaluation index of the meat to be evaluated, and obtaining a corresponding evaluation index vector. The marble pattern of the meat to be evaluated is evaluated based on the evaluation index vector, and the evaluation grade corresponding to the meat to be evaluated is determined, thereby realizing an objective evaluation of the meat marbling pattern based on the evaluation index. Compared with manual evaluation, the investment in manpower cost is reduced, the evaluation efficiency is improved, and the influence of subjectivity and arbitrariness on the evaluation results is avoided, thereby improving the accuracy and authority of the evaluation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 The figure is a schematic diagram of the process of the meat marbling evaluation method provided by the present invention.
[0018] Figure 2 It is a schematic diagram of the process of extracting parameters of meat marbling provided by the present invention.
[0019] Figure 3 This is one of the schematic diagrams of the meat marbling evaluation process provided by the present invention.
[0020] Figure 4 This is one of the schematic diagrams of the construction process of the meat marbling evaluation standard array provided by the present invention.
[0021] Figure 5 This is the second schematic diagram of the construction process of the meat marbling evaluation standard array provided by the present invention.
[0022] Figure 6 This is the second schematic diagram of the meat marbling evaluation process provided by the present invention.
[0023] Figure 7 It is a schematic diagram of the structure of the meat marbling evaluation device provided by the present invention.
[0024] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] The embodiment of the present invention provides a method for evaluating the marbling pattern of meat products. The method is based on computer vision technology, and the video images of meat products are collected for analysis. Based on a constructed evaluation system, evaluation indicators of the meat products are extracted from the video images. According to the extracted evaluation indicators, the marbling pattern of the meat products is objectively evaluated, thereby reducing the subjectivity and arbitrariness of the evaluation results and improving the accuracy and authority of the evaluation results.
[0027] Specifically, Figure 1 : is a schematic diagram of the process of the meat marbling evaluation method provided by the present invention, such as Figure 1 As shown, the method comprises the following steps: Step 101: Collect a video image of the meat to be evaluated, and extract pattern parameters of the marble pattern of the meat to be evaluated based on the video image; the pattern parameters include the pattern area, pattern perimeter and pattern quantity of the marble pattern; Step 102: determining the index values of the evaluation indexes corresponding to the meat product to be evaluated according to the pattern parameters, and obtaining the evaluation index vector of the meat product to be evaluated; Step 103: Evaluate the marbling of the meat to be evaluated based on the evaluation index vector, and determine the evaluation grade corresponding to the meat to be evaluated.
[0028] Video images of the meat to be evaluated are collected, and pattern parameters of the marble pattern of the meat to be evaluated are extracted based on the collected video images, wherein the pattern parameters include the pattern area, pattern perimeter, and pattern quantity of the marble pattern.
[0029] Optionally, the video images of the meat to be evaluated may be collected during the production and processing of the meat to be evaluated, before the product is packaged, or before the product arrives and enters the warehouse. The meat to be evaluated may be commercially available red meat such as beef and pork in different packaging forms such as skin packaging or vacuum packaging.
[0030] Optionally, the video image of the meat to be evaluated is an image of a preset size, and the preset size can be determined according to the distance between the meat to be evaluated and the image acquisition device. In one embodiment, the image acquisition device acquires the video image above the meat to be evaluated, and the height of the image acquisition device determines the image size of the acquired video image.
[0031] When extracting the pattern parameters of the marble pattern of the meat to be evaluated based on the collected video image, the collected video image is binarized to obtain the corresponding binarized image, and the target area corresponding to the meat to be evaluated is determined from the binarized image. Based on the binarization result, the pixel points corresponding to the marble pattern in the target area are counted to determine the pattern parameters such as the pattern area, pattern perimeter and pattern number of the marble pattern.
[0032] The index values of the evaluation indicators corresponding to the meat product to be evaluated are determined according to the extracted pattern parameters to obtain the evaluation index vector of the meat product to be evaluated. The evaluation indicators include one or more, and the index values of the evaluation indicators are calculated in sequence based on the extracted pattern parameters, and the index values of the evaluation indicators are combined into a vector form to obtain the evaluation index vector of the meat product to be evaluated.
[0033] Furthermore, the marbling of the meat to be evaluated is evaluated based on the evaluation index vector, and the evaluation grade corresponding to the meat to be evaluated is determined.
[0034] In one embodiment, based on the evaluation index vector, the index values of each evaluation index are weighted and summed to obtain the evaluation score of the marbling of the meat to be evaluated, and the evaluation grade corresponding to the meat to be evaluated is determined according to the evaluation score. Wherein, for the evaluation grade, the interval is divided according to the score range of the evaluation score of the marbling, and the score range of the marbling is divided into multiple score intervals, each score interval corresponds to an evaluation grade, and the evaluation grade corresponding to the meat to be evaluated is determined according to the score interval to which the evaluation score of the marbling of the meat to be evaluated belongs.
[0035] In another embodiment, the evaluation index includes multiple evaluation indicators, each evaluation indicator corresponds to an indicator value range, and the indicator value range of each evaluation indicator is divided into multiple score intervals, each score interval corresponds to an evaluation score. Then, based on the evaluation index vector, each evaluation indicator is evaluated, and the score interval corresponding to the indicator value of each evaluation indicator is determined, thereby obtaining the indicator score of the evaluation indicator. Finally, the indicator score of each evaluation indicator is weighted and summed to obtain the final evaluation score of the marbling of the meat to be evaluated, and the evaluation grade corresponding to the meat to be evaluated is determined according to the evaluation score.
[0036] In some embodiments, multiple evaluation indicators may have a cascade relationship. Based on the evaluation indicator vector, decisions and judgments are made on each evaluation indicator with a cascade relationship in turn, thereby evaluating the marbling of the meat to be evaluated and determining the evaluation level corresponding to the meat to be evaluated.
[0037] In this embodiment, by collecting video images of the meat to be evaluated, and extracting the pattern parameters of the marble pattern of the meat to be evaluated, and then determining the index value of the evaluation index of the meat to be evaluated, a corresponding evaluation index vector is obtained, and the marble pattern of the meat to be evaluated is evaluated based on the evaluation index vector, and the corresponding evaluation grade of the meat to be evaluated is determined, thereby realizing an objective evaluation of the marble pattern of the meat based on the evaluation index. Compared with manual evaluation, this method reduces the investment in manpower costs, improves evaluation efficiency, avoids the influence of subjectivity and arbitrariness on the evaluation results, and improves the accuracy and authority of the evaluation results.
[0038] In one embodiment, the extraction of pattern parameters of the marble pattern is achieved based on the binarization processing of the image. In step 101, the pattern parameters of the marble pattern of the meat to be evaluated are extracted from the collected video image, which may also include: Step 201, extracting a target frame image from the video image, and performing threshold segmentation processing on the target frame image to obtain a binary template of a target interest area corresponding to the meat product to be evaluated; the target frame image is collected when the meat product to be evaluated is located in a preset detection area; Step 202, using the area as a filtering parameter, after performing morphological filtering on the binary template, perform dot multiplication with the target frame image to obtain a target object image of the meat to be evaluated; Step 203: extracting pattern parameters of the marbling of the meat to be evaluated based on the target image.
[0039] A target frame image is extracted from the video image, and a threshold segmentation process is performed on the target frame image to obtain a binary template of a target interest area corresponding to the meat to be evaluated. Optionally, any frame image in the collected video image of the meat to be evaluated is used as the target frame image, and optionally, the target frame image is collected when the meat to be evaluated is located in a preset detection area, and optionally, the center of the detection area is the center of the field of view of the image acquisition device, that is, the center of the detection area is the center of the collected video image.
[0040] In one embodiment, after the video image is collected, the video image can also be downsampled, so that when the meat to be evaluated does not enter the detection area, a lower downsampling rate can be set to reduce the storage space occupied by the image matrix in the memory during online detection, reduce the calculation complexity, and speed up the operation. For example, the resolution of the original video image frame of the meat to be evaluated collected is 1920×1080×3, and the height and width of the video image are scaled to 0.25 respectively, then the downsampling rate is 0.0625, the image frame size is reduced to 480×270×3, the data volume is 1 / 16 of the original video image, and the memory occupancy is 379.7KB. This image matrix is used for the analysis and judgment of the meat to be evaluated. For another example, the video image is scaled by 0.1, the original video image frame size is reduced to 192×108×3, the downsampling rate is 1 / 100, and the memory occupancy is 60.8KB. This image matrix is used as the basis for judging whether the meat to be evaluated enters the detection area.
[0041] Further, refer to Figure 2 The parameter extraction process shown in the figure, after extracting the target frame image, performs threshold segmentation processing on the target frame image to obtain the corresponding binary template, uses the area as the filtering parameter, performs morphological filtering processing on the binary template to obtain a binary template that filters out interference and background, and performs dot multiplication between the filtered binary template and the target frame image to obtain the target object image of the meat to be evaluated.
[0042] Optionally, threshold segmentation processing of the target frame image may specifically include performing median filtering on the target frame image, and then determining a segmentation threshold according to the pixel value of each pixel in the filtered image, performing pixel segmentation on the filtered image based on the segmentation threshold, assigning True to pixels whose pixel values are greater than the segmentation threshold, and assigning False to pixels whose pixel values are less than or equal to the segmentation threshold, to obtain a binary template.
[0043] Optionally, the target frame image can be determined by the position of the meat to be evaluated in the video image. Specifically, the center of mass position of the meat to be evaluated is obtained based on part or all of the meat to be evaluated contained in the video image, and based on the distance between the center of mass of the meat to be evaluated and the midline of a preset detection area, it is determined whether the meat to be evaluated has entered the detection area.
[0044] For the centroid of the meat to be evaluated, based on the binarization processing of the video image, the pixel coordinates of the first non-zero pixel point in the four directions of up, down, left, and right in the binary image of the target interest area corresponding to the meat to be evaluated in each video image are obtained, the coordinates of the origin and diagonal points of the circumscribed rectangle of the target interest area are obtained, and the circumscribed rectangle of the target interest area is constructed. The horizontal and vertical coordinates of the origin of the circumscribed rectangle are added to half of the width and height of the circumscribed rectangle respectively to obtain the centroid coordinates of the target interest area of the meat to be evaluated.
[0045] Furthermore, the binary matrix of the target interest area of the meat to be evaluated is converted into a column vector, the column index of the first and last non-zero pixel in the column vector is obtained, and the column index is divided and modulo operation is performed with the height of the video image to obtain the coordinates [Ox, r1] and [Oex, r2]. The binary matrix of the target interest area of the meat to be evaluated is transposed and converted into a column vector, the column index of the first and last non-zero pixel in the column vector is obtained, and the column index is divided and modulo operation is performed with the width of the video image to obtain the coordinates [r3, Oy] and [r4, Oey], and the coordinates are transposed to obtain [Oy, r3] and [Oey, r4].
[0046] According to the calculated coordinates [Ox, r1], [Oex, r2], [Oy, r3] and [Oey, r4], the minimum enclosing rectangle of the target interest area corresponding to the meat to be evaluated is determined. The origin coordinates of the minimum enclosing rectangle are [Ox, Oy], and the diagonal coordinates are [Oex Oey]. The coordinate form of the minimum enclosing rectangle is [Ox, Oy, Oex-Ox, Oey-Oy]. The width of this minimum enclosing rectangle is (Oex-Ox), and half of the width is (Oey-Oy). Add them to the origin coordinates to obtain the centroid coordinates of the target interest area of the meat to be evaluated [Ox+(Oex-Ox) / 2, Oy+(Oey-Oy) / 2].
[0047] In one embodiment, the position of the meat to be evaluated is tracked according to the minimum circumscribed rectangle, wherein the detection area of the meat to be evaluated is a rectangular area, and its coordinate form is [Dx, Dy, H, W], the origin coordinates of the area are [Dx, Dy], the diagonal coordinates are [Dx+H, Dy+W], and the center coordinates are [Dx+H / 2, Dy+W / 2]. When the position of the minimum circumscribed rectangle satisfies Ox≥Dx, Oy≤Dy, Oex≤Dx+H, Oey≥Dy+W, it can be determined that the circumscribed rectangle of the target interest area of the meat to be evaluated has entered the detection area, and the video image collected at this time is the target frame image.
[0048] It can be understood that after acquiring the video image of the meat to be evaluated, based on the position of the minimum circumscribed rectangle of the target interest area corresponding to the meat to be evaluated in the acquired video image, it can be determined whether the meat to be evaluated is located in the detection area, thereby realizing online real-time monitoring of the meat to be evaluated, extracting the video image acquired when the meat to be evaluated is located in the detection area, and obtaining the target frame image for evaluation and analysis of the meat to be evaluated.
[0049] In one embodiment, referring to Figure 3The detection and evaluation process of the meat to be evaluated shown in the figure is to collect any frame of the video image of the meat to be evaluated on the conveyor belt, perform downsampling on the frame image, and obtain the binary template of the interest area corresponding to the target interest area of the meat to be evaluated in the image. Based on the binary template of the interest area, the origin, diagonal points and centroid of the minimum circumscribed rectangle of the target interest area are calculated in the above manner to determine whether the meat to be evaluated enters the detection area. After the meat to be evaluated enters the detection area, when the distance between the centroid of the minimum circumscribed rectangle of the target interest area and the midline of the detection area is less than a preset threshold, the target frame image of the meat to be evaluated is obtained, and the marbling of the meat to be evaluated is evaluated based on the target frame image.
[0050] Optionally, step 203 may further include: Step 301, determining the minimum bounding rectangle of the meat to be evaluated based on the binary template, and cutting the target image according to the minimum bounding rectangle to obtain an image of the region of interest of the meat to be evaluated; Step 302, binarizing the image of the region of interest to obtain a binary image of the region of interest; Step 303, performing a dot product on the interest region binary image and the interest region image to obtain a pattern binary image of each marble pattern in the target interest region; Step 304, constructing a label matrix of each marble pattern in the target interest area according to the pattern binary image; the label serial number of the label matrix is used to represent the serial number of each marble pattern in the target interest area; Step 305: extracting pattern parameters of the marbling of the meat to be evaluated based on the label matrix.
[0051] The minimum bounding rectangle of the meat to be evaluated is determined based on the binary template. Specifically, the minimum bounding rectangle of the meat to be evaluated is determined based on the binary template after morphological filtering and filtering out interference and background. The target image is cut according to the minimum bounding rectangle of the meat to be evaluated to obtain the image of the area of interest of the meat to be evaluated. Figure 2 As shown, the cut region of interest image is further binarized to obtain a binary image of the region of interest and a binary pattern image of each marble pattern in the target region of interest. A label matrix of the marble pattern is constructed based on the binary pattern image of each marble pattern. The label sequence of the label matrix is used to ensure the sequence of each marble pattern in the target region of interest. The pattern parameters of the marble pattern of the meat to be evaluated are extracted based on the constructed label matrix.
[0052] Further, the pattern area of the extracted marble pattern is the pixel area, and the pattern perimeter of the marble pattern is the pixel perimeter. Specifically, according to the label matrix corresponding to each marble pattern, the number of pixel points whose pixel value corresponding to the marble pattern is the first eigenvalue is counted to obtain the pixel area of the marble pattern, and the number of pixel points whose connectivity of the peripheral pixels of the label matrix is the preset value is counted to obtain the pixel perimeter of the marble pattern. The maximum label sequence number of the label matrix is the pattern number of the marble pattern. Exemplarily, the first eigenvalue is 1 and the preset value is 8.
[0053] Optionally, after performing median filtering on the target frame image of the meat to be inspected, a pixel segmentation threshold is obtained based on the image information after filtering, and pixels with values greater than the segmentation threshold are assigned a value of True, while pixels with other pixel values are assigned a value of False. A binary template of the target area of interest of the meat to be evaluated is constructed, and after morphological filtering with area as the filtering parameter, a binary template of the area of interest that filters out interference and background is obtained, and the template is dot-multiplied with the target frame image to obtain the target object image of the meat to be evaluated.
[0054] By obtaining the binary template of the region of interest that filters out interference and background, the coordinates of the first non-zero pixel point in the four directions of up, down, left, and right are obtained to obtain the origin (Ox, Oy) and diagonal point coordinates (Oex, Oey) of the minimum bounding rectangle, which is in the form of [Ox, Oy, Oex-Ox, Oey-Oy]. The image within the minimum bounding rectangle is cut, which is the target image with a size of (Oex-Ox) × (Oey-Oy). Perform global threshold segmentation on the target image to construct a binary image of the region of interest, or find pixels with pixel values greater than the global segmentation threshold and assign them False, construct a binary matrix and invert it to obtain a binary image of the region of interest.
[0055] The binary image of the region of interest is dot-multiplied with the region of interest image, and all non-zero pixels are locally threshold segmented, or the red component layer in the region of interest image is segmented using a fixed threshold, to obtain a binary image of all marbling patterns in the target region of interest corresponding to the meat to be evaluated.
[0056] Optionally, the meat to be evaluated includes multiple evaluation indicators, which are specifically determined according to the evaluation criteria of the meat to be evaluated. Different evaluation criteria correspond to different evaluation systems, and the evaluation indicators corresponding to different evaluation systems may be the same or different. Based on this, step 102 may include: Step 401, obtaining an evaluation system corresponding to the evaluation standard corresponding to the meat product to be evaluated; Step 402, determining each evaluation index corresponding to the evaluation system; Step 403, calculating the index value of each evaluation index according to the pattern parameters to obtain the index vector of the meat to be evaluated.
[0057] When determining the index values of the evaluation indexes corresponding to the meat to be evaluated according to the pattern parameters, thereby obtaining the evaluation index vector of the meat to be evaluated, first, an evaluation system corresponding to the evaluation standard corresponding to the meat to be evaluated is obtained. Optionally, one or more evaluation standards can be used to evaluate the meat to be evaluated, different evaluation standards correspond to different evaluation systems, and different evaluation systems have the same or different evaluation indicators.
[0058] According to the evaluation system corresponding to one or more evaluation standards corresponding to the meat to be evaluated, the evaluation indicators corresponding to the meat to be evaluated are determined, and then the index value of each evaluation indicator is calculated based on the extracted pattern parameters. Then, according to the evaluation system corresponding to different evaluation standards, the index values of each evaluation indicator are combined, and the index values of the evaluation indicators under the same evaluation system are used as elements in the same vector to obtain the evaluation index vector corresponding to each evaluation standard.
[0059] Optionally, one evaluation criterion corresponds to one evaluation index vector, or multiple evaluation criteria correspond to one evaluation index vector, and one evaluation criterion corresponds to a part of one evaluation index vector.
[0060] In one embodiment, the index value of the full evaluation index can also be calculated based on the extracted pattern parameters, and then the index value of each evaluation index under the evaluation standard is selected from the full evaluation index according to the evaluation standard corresponding to the meat to be evaluated to form an evaluation index vector.
[0061] In this way, different standards can be used to evaluate meat products, and based on the configured full-scale standard evaluation system and evaluation indicators, users can select the required evaluation standards according to actual evaluation needs, and adaptively match the corresponding evaluation indicators and perform calculations according to the evaluation standards selected by users, thereby realizing the adaptive ability of the evaluation indicators. At the same time, the applicability and generalization ability of meat marbling evaluation are improved.
[0062] Furthermore, the calculation of the index value of the evaluation index is based on the extracted pattern parameters and is achieved in combination with the meat parameters. Based on this, step 102 may also include: Step 501, extracting meat parameters of the meat to be evaluated from the video image; the meat parameters include meat area and meat perimeter; Step 502, obtaining a conversion coefficient between a pixel area and an actual area, and calculating the index value of each evaluation index corresponding to the meat to be evaluated according to the conversion coefficient, the pattern parameter and the meat parameter, to obtain an evaluation index vector of the meat to be evaluated; The evaluation index includes at least one of pattern area ratio, pattern density, pattern diversity index, pattern uniformity index, pattern separation index, pattern shape index and pattern aggregation index.
[0063] Extract meat parameters of the meat to be evaluated from the video image, the meat parameters include meat area and meat perimeter, obtain a conversion coefficient between pixel area and actual area, calculate based on the conversion coefficient, pattern parameter and meat parameter, obtain the index value of the evaluation index corresponding to the meat to be evaluated, and use the index value of each evaluation index as a vector element to combine into an evaluation index vector. Optionally, different evaluation indicators are calculated in different ways, and the index value of any evaluation indicator is calculated based on at least one of the conversion coefficient, meat parameter and pattern parameter.
[0064] Furthermore, the evaluation index includes at least one of the Marbling Area Proportion (MAP), Marbling Cohesion Index (MCI), Marbling Density (MD), Marbling Diversity Index (MDI), Marbling Evenness Index (MEI), Marbling Splitting Index (MSI) and Marbling Shape Index (MSPI).
[0065] Optionally, the meat parameters may be extracted during the extraction of the pattern parameters, the meat area in the meat parameters is the meat pixel area, and the meat perimeter is the meat pixel perimeter. Figure 2 As shown, when extracting the meat parameters of the meat to be evaluated from the video image, specifically based on the binary image of the interest area, the number of pixel points whose pixel values are the first eigenvalue is counted to obtain the pixel area of the meat to be evaluated, and the number of pixel points whose peripheral pixel connectivity of the binary image of the interest area is a preset value is counted to obtain the pixel perimeter of the meat to be evaluated. The pixel value of the pixel point of the binary image of the interest area is the first eigenvalue or the second eigenvalue. For example, the first eigenvalue is 255 and the second eigenvalue is 0. The number of pixel points whose pixel value in the binary image of the interest area is the first eigenvalue is accumulated to obtain the pixel area of the meat to be evaluated. According to the extracted pattern parameters and meat parameters, the index value of each evaluation index is calculated, and the index value of the evaluation index is combined into a vector form to obtain the evaluation index vector of the meat to be evaluated.
[0066] In this embodiment, a plurality of evaluation indicators constitute an evaluation system for meat marbling, and the evaluation indicators include at least one of pattern area ratio (MAP), pattern density (MD), pattern diversity index (MDI), pattern uniformity index (MEI), pattern separation index (MSI), pattern shape index (MSPI) and pattern aggregation index (MCI).
[0067] Furthermore, the pattern area ratio MAP is calculated by the number of patterns representing the marble pattern in the target interest area, the pixel area of the pattern and the pixel area of the meat to be evaluated, and the calculation method is shown in Formula 1: ; (1) Where N represents the number of marble patterns in the target area of interest, (i=1,2,...,N) represents the first i The pixel area of the marble pattern, is the pixel area of the meat to be evaluated.
[0068] For the pattern density MD, the number of patterns N , the conversion coefficient between pixel area and actual area and the pixel area of the meat to be evaluated are calculated, as shown in Formula 2: ; (2) in, Indicates the conversion coefficient between pixel area and actual area, that is, the number of pixels per square centimeter.
[0069] The pattern aggregation index MCI is calculated by the number of patterns N, the pixel perimeter of the pattern, the pixel area of the pattern and the pixel area of the meat to be evaluated, as shown in Formula 3: ; (3) In formula 3, Indicates the target area of interest i ( i =1,2,..., N ) is the pixel perimeter of the marble pattern.
[0070] The pattern diversity index MDI is calculated by the number of pattern area intervals, the number of patterns in each pattern area interval, the pixel area of each marble pattern in any pattern area interval, and the pixel area of the meat to be evaluated, as shown in Formula 4: ; (4) In formula 4, The number of intervals representing the pattern area, Indicates i The number of patterns in the pattern area interval, Indicates i Within the pattern area interval j The pixel area of the stripe pattern ( i =1,2,..., m ; j =1,2,…, n ). Optionally, the number of pattern area intervals corresponds to the number of evaluation levels, and one pattern area interval corresponds to one evaluation level.
[0071] The pattern uniformity index MEI is calculated by the number of intervals of the pattern area and the pattern diversity index, as shown in Formula 5: ; (5) The pattern separation index (MSI) is a measure of the pixel area and number of patterns of the meat to be evaluated. N And the pixel area of each pattern is calculated, as shown in Formula 6: ; (6) The pattern shape index MSPI is calculated by the number of patterns. N , the pixel perimeter of the meat to be evaluated and the pixel area of the meat to be evaluated are calculated, as shown in Formula 7: ; (7) in, is the shape adjustment coefficient. For example, the adjustment coefficient based on a square is 0.25, and the adjustment coefficient based on a circle is , is the pixel perimeter of the meat to be evaluated.
[0072] In one embodiment, in step 102, the index value of each evaluation index corresponding to the meat to be evaluated is determined according to the extracted pattern parameters to obtain an evaluation index vector of the meat to be evaluated. Specifically, in the above-mentioned manner, the meat parameters of the meat to be evaluated are extracted, the conversion coefficient between the pixel area and the actual area, and the evaluation standard of the meat to be evaluated are obtained, and the evaluation index corresponding to the meat to be evaluated is determined according to the evaluation system corresponding to the evaluation standard, and then the index value of each evaluation index is calculated based on the extracted pattern parameters, the meat parameters and the obtained conversion coefficient to obtain the evaluation index vector of the meat to be evaluated.
[0073] Optionally, depending on different evaluation criteria, the evaluation indicators include one or more of pattern area ratio, pattern density, pattern diversity index, pattern uniformity index, pattern separation index, pattern shape index and pattern aggregation index.
[0074] Optionally, the conversion coefficient between the pixel area and the actual area is determined based on a standard reference object. In step 502, obtaining the conversion coefficient between the pixel area and the actual area may also include: Step 601, obtaining a reference image of a preset reference object; the reference image is acquired by collecting the reference object in a preset detection area, and the actual area of the reference object is a preset standard area; Step 602, performing color space conversion on the reference image to obtain a grayscale image; Step 603, filtering the grayscale image to obtain a filtered image, and determining a segmentation threshold according to the pixel value of each pixel in the filtered image; Step 604, performing threshold segmentation on the filtered image based on the segmentation threshold to obtain a foreground binary image of the reference object interest area corresponding to the reference object; Step 605, performing morphological filtering on the foreground binary image to obtain a reference binary template; Step 606, counting the target number of pixel points corresponding to the reference object in the reference object binary template to obtain the pixel area of the reference object; Step 607, calculating the ratio of the pixel area of the reference object to the standard area, and obtaining a conversion coefficient between the pixel area and the actual area.
[0075] A reference image of a preset reference object is obtained, where the reference object is a reference object of a selected standard area, which has a specific shape, color and actual area. For example, a reference object of a regular shape such as a square, circle or rectangle, a color with a significant step contrast with the background color, and an area of 1, 2, 5 or 10 square centimeters is selected.
[0076] Furthermore, the reference image is obtained by capturing an image of a reference object within a preset detection area, and the actual area of the reference object is a preset standard area. Exemplarily, a white, 1 cm2 square is used as the reference object of the standard area.
[0077] The reference image is converted into a color space such as HIS, LAB, HSV, etc. to obtain a corresponding color space image, so as to retain the apparent color characteristics of the reference object under the standard area, and a layer in the color space image is taken as the grayscale image corresponding to the reference image. The grayscale image is filtered at a specific size to remove noise interference and obtain a filtered image. The filtering methods include but are not limited to median filtering, mean filtering, Gaussian filtering, high-pass filtering and band-stop filtering.
[0078] Furthermore, the segmentation threshold is determined according to the pixel value of each pixel point in the filtered image. For example, the segmentation threshold can be calculated by using a fixed value, a mean value method, a histogram method, an entropy value method, an adaptive threshold method, or a global threshold method. The filtered image is subjected to threshold segmentation based on the calculated segmentation threshold to obtain a foreground binary image of the reference object interest area corresponding to the reference object.
[0079] The foreground binary image is subjected to morphological filtering. In the foreground binary image of the reference object obtained, there is interference caused by the reflection of the light source by the packaging material and the surface grease, and it may not be completely eliminated after the filtering operation. According to the accuracy requirements of the conversion coefficient, the foreground binary image needs to be subjected to a morphological filtering before the number of pixels of the reference object in the foreground binary image is counted. For example, a label matrix of the obtained foreground binary image is established, and the maximum value of all pixel labels in the label matrix is obtained. The pixel label is used to characterize the number of foreground objects in the foreground binary image. If it is 1, no morphological filtering is performed. If it is greater than 1, a morphological filtering with area as the filtering parameter is performed to obtain the foreground binary image with the largest pixel area, and obtain the reference object binary template. The target number of non-zero pixels in the reference object binary template is counted to obtain the pixel area of the reference object.
[0080] Furthermore, the ratio of the pixel area of the reference object to the actual standard area of the reference object is calculated to obtain a conversion coefficient between the pixel area and the actual area. In one embodiment, the reference image obtained includes images of the reference object acquired by the image acquisition device at different heights. When the image acquisition device acquires images at different heights, the focal length needs to be adjusted to obtain clear images of the standard area reference object at different heights.
[0081] Optionally, based on the standard reference object, the conversion coefficient between the pixel area and the actual area when the image acquisition device is set at different heights can be pre-calculated and stored, or a relationship model between the corresponding conversion coefficient and the setting height of the image acquisition device can be established to facilitate the subsequent acquisition of the conversion coefficient. Specifically, for the reference object image acquired by the image acquisition device at any height, the pixel area of the reference object at the height is calculated in the above manner, the pixel area of the reference object obtained at each height is associated with the height of the corresponding image acquisition device, and a relationship model with the height as the independent variable and the pixel area as the dependent variable is established: P=f(x), and then divided by the standard area of the reference object, that is, the actual area of the reference object, to establish a relationship model between the conversion coefficient and the height of the image acquisition device: PA=g(x), where x is the height of the image acquisition device. Alternatively, for the reference object image acquired by the image acquisition device at any height, the conversion coefficient between the pixel area of the reference object at the height and the actual area is calculated in the above manner, the conversion coefficient obtained at each height is associated with the height of the corresponding image acquisition device, and a relationship model with the height as the independent variable and the conversion coefficient as the dependent variable is established: PA=g(x).
[0082] Based on the established relationship model PA=g(x), when the setting height of the image acquisition device is known, the setting height x of the image acquisition device is substituted into the relationship model PA=g(x) to solve the conversion coefficient between the pixel area and the actual area at this height.
[0083] Further, the evaluation of the marbling of the meat to be evaluated is performed based on the evaluation index vector, and the evaluation grade corresponding to the meat to be evaluated is determined based on matching the evaluation standard vector with a pre-constructed evaluation standard array. Specifically, step 103 may also include: Step 701, matching the evaluation index vector with an evaluation standard array to determine a target standard vector that matches the evaluation index vector; Step 702, determining the evaluation level corresponding to the meat product to be evaluated according to the evaluation level corresponding to the target standard vector; Among them, the evaluation standard array is constructed based on the evaluation standard vector corresponding to each evaluation level, and the evaluation standard vector is composed of the standard index value of the evaluation index corresponding to each evaluation level, and the standard index value is calculated based on the pattern parameters extracted from the standard image of meat corresponding to each evaluation level.
[0084] The evaluation index vector is matched with the evaluation standard array to determine the target standard vector that matches the evaluation index vector, and the evaluation grade corresponding to the meat product to be evaluated is determined according to the evaluation grade corresponding to the target standard vector. Optionally, the evaluation grade corresponding to the target standard vector is the evaluation grade corresponding to the meat product to be evaluated, or, based on the evaluation grade corresponding to the target standard vector, according to the matching degree between the evaluation index vector of the meat product to be evaluated and the target standard vector, the evaluation grade corresponding to the meat product to be evaluated is determined to be the adjacent grade of the evaluation grade corresponding to the target standard vector.
[0085] The matching of the evaluation index vector and the evaluation standard array includes but is not limited to matching the evaluation index vector with each evaluation standard vector in the evaluation standard array, determining the matching degree between the evaluation index vector and each evaluation standard vector, and the evaluation standard vector with the largest matching degree is the target standard vector. The matching between the evaluation index vector and the evaluation standard vector can be characterized by similarity, and the similarity can be calculated by Euclidean distance, Manhattan distance, Chebyshev distance, angle cosine or Pearson correlation coefficient.
[0086] Optionally, the evaluation standard array is constructed based on the evaluation standard vectors corresponding to each evaluation level, that is, the evaluation standard array includes evaluation standard vectors for each evaluation level, and the evaluation standard vectors are composed of standard index values of evaluation indicators corresponding to each evaluation level, and the standard index values are calculated from pattern parameters extracted from standard meat images corresponding to each evaluation level.
[0087] That is, for the meat standard images or meat standard image groups used to guide the evaluation of marbling grades in the current effective standards, the same processing method as the meat to be evaluated is used to extract the pattern parameters at each evaluation level, and the standard index values of each evaluation index are calculated, and the standard index values are combined into a vector form to obtain the evaluation standard vector at each evaluation level. Optionally, the pattern parameters are extracted from the meat standard images at each evaluation level, the pattern pixel areas in the pattern parameters are sorted in descending order, the maximum value of the pattern pixel area is obtained, and the pattern pixel area is divided into a number of pattern area intervals from 0 to the maximum value of the pattern pixel area, and different pattern area intervals correspond to different evaluation levels.
[0088] Optionally, any evaluation level corresponds to one or more standard meat images. If any evaluation level corresponds to one standard meat image, then one evaluation level corresponds to one evaluation standard vector, and the evaluation standard array is composed of the evaluation standard vectors of each evaluation level. If any evaluation level corresponds to multiple standard meat images, then one evaluation level corresponds to one evaluation standard matrix, and the evaluation standard array is composed of the standard evaluation matrix corresponding to each evaluation level. The evaluation standard matrix is composed of a maximum value vector and a minimum value vector. The maximum value vector is composed of the maximum value of the evaluation index corresponding to the evaluation level, and the minimum value vector is composed of the minimum value of the evaluation index corresponding to the evaluation level.
[0089] Specifically, refer to Figure 4 For a standard image of meat of any evaluation level, a binary image of the area of interest of the standard image of meat and a binary image of the pattern of each marble pattern in the area of interest are obtained in the same processing method as the target frame image of the meat to be evaluated. Meat parameters are extracted based on the binary image of the area of interest, and pattern parameters are extracted based on the binary image of the pattern. Then, based on each evaluation index in the evaluation system, the standard index value of each evaluation index is calculated through the extracted meat parameters and pattern parameters.
[0090] Optionally, if an evaluation level corresponds to a standard image of meat, the standard index value of the evaluation index of any evaluation level constitutes an evaluation standard vector BV, and the evaluation standard vectors BV corresponding to each evaluation level constitute an evaluation standard array BA. If an evaluation level corresponds to multiple standard images of meat, the maximum and minimum values of the same evaluation index are determined according to the standard index values of the evaluation index corresponding to each standard image of meat, and a maximum value vector is formed according to the maximum values of the indicators of each evaluation index, and a minimum value vector is formed according to the minimum values of each evaluation index. Based on the maximum value vector and the minimum value vector, an evaluation standard matrix BM corresponding to any evaluation level is constructed, and finally an evaluation standard array BAM is constructed according to the evaluation standard matrix corresponding to each evaluation level. It should be noted that if the evaluation standard array is BAM, the target standard vector that matches the evaluation index vector of the meat to be evaluated includes a target maximum value vector and a target minimum value vector, and the target maximum value vector and the target minimum value vector constitute a target evaluation standard matrix.
[0091] For example, if the evaluation index in the evaluation system is a scalar of seven index values, namely, pattern area ratio (MAP), pattern density (MD), pattern diversity index (MDI), pattern uniformity index (MEI), pattern separation index (MSI), pattern shape index (MSPI) and pattern aggregation index (MCI), and if one evaluation level corresponds to one meat standard image, then based on the meat standard image of the kth evaluation level, the calculated standard index values can be sorted column-wise to obtain an evaluation standard vector BV with a size of 7×1. k , , M is the number of evaluation levels. If one evaluation level corresponds to multiple meat standard images, then for multiple meat standard images of the kth evaluation level, the index value of each evaluation index is calculated based on each meat standard image. The same evaluation index has multiple index values corresponding to each meat standard image, from which a maximum value and a minimum value are selected as the index value range of the evaluation index at the evaluation level. When constructing the evaluation standard array, the minimum value of each evaluation index is used as the first column, and the maximum value is used as the second column to form an evaluation standard matrix BM with a size of 7×2 k The evaluation standard matrix BM corresponding to each evaluation level constitutes the evaluation standard array BAM.
[0092] Further, refer to Figure 5 For multiple evaluation standard vectors BA or multiple evaluation standard matrices BM, multi-standard cascades can be performed according to different evaluation indicators to form a multi-standard high-dimensional evaluation indicator set. If one evaluation level corresponds to a meat standard image, then for the evaluation standard vectors BV1 to BV2 corresponding to 1 to M evaluation levels, MCascade to construct the evaluation standard array BA. If one evaluation level corresponds to multiple meat standard images, the evaluation standard vectors BM1 to BM corresponding to 1 to M evaluation levels are M Cascade is performed to construct the evaluation standard array BAM.
[0093] When matching the evaluation index vector of the meat product to be evaluated with the evaluation standard array, a traversal form is used to compare the evaluation index vector of the meat product to be evaluated with each evaluation standard vector or evaluation standard matrix in the evaluation standard array.
[0094] Optionally, the evaluation index vector DV of the meat to be evaluated is compared with each evaluation standard vector BV in the evaluation standard array BA, or the evaluation index vector DV of the meat to be evaluated is compared with each evaluation standard matrix BM in the evaluation standard array BAM. Specifically, the evaluation index vector DV[1] of the meat to be evaluated is traversed and compared with the evaluation standard array BA[1,:] or BAM[1,1:2,:]. When DV[1] is greater than or equal to a certain value BA[1,i] in BA[1,:], the column number i of BA[1,i] is the candidate level of the meat to be evaluated. If there are multiple values in BA[1,:] that meet the requirements, the column number i corresponding to the maximum value is taken as the candidate level of the meat to be evaluated. Alternatively, when DV[1] is greater than or equal to BAM[1,1,:] and less than or equal to a certain interval BAM[1,1:2,i] in BAM[1,2,:], its dimension i is the candidate level matched by the meat to be evaluated; if DV[1] does not meet the requirements of BA[1,:] or BAM[1,1:2,:], the meat to be evaluated is an abnormal product.
[0095] That is, according to the first evaluation indicator in the cascaded evaluation indicators, the evaluation indicator vector of the meat to be evaluated is matched with the evaluation standard matrix to determine the candidate grade of the meat to be evaluated, and the evaluation indicator vector is further matched with the standard evaluation vector or standard evaluation matrix corresponding to the candidate grade to determine whether the evaluation grade of the meat to be evaluated is the candidate grade. After determining that the candidate grade of the meat to be evaluated is grade i, the evaluation index vector DV[2:7] of the meat to be evaluated is compared with the index value or index value interval of each evaluation index in the evaluation standard array BA[2:7,i] or BAM[2:7,1:2,i]; if the similarity between DV[2:7] and BA[2:7,i] is greater than or equal to the preset similarity threshold, the evaluation grade of the marbling of the meat to be evaluated is grade i; or, when the index value of each evaluation index in DV[2:7] is within the numerical range corresponding to each evaluation index in the evaluation standard array BAM[2:7,1:2,i], the evaluation grade of the marbling of the meat to be evaluated is grade i.
[0096] If the evaluation index vector DV[2:7] of the meat to be evaluated does not match the evaluation standard array BA[2:7,i] or BAM[2:7,1:2,i], the evaluation is downgraded and the evaluation level of the marbling of the meat to be evaluated is reduced to level i-1. During the downgrade evaluation, if the candidate level i of the marbling of the meat to be evaluated is already the lowest level (level 1), the meat to be evaluated is an abnormal product.
[0097] Optionally, after determining the evaluation grade corresponding to the meat to be evaluated, it is also necessary to mark the grade of the meat to be evaluated, so as to facilitate the subsequent sorting of the meat to be evaluated. Based on this, after step 103, the following may also be included: Step 801, determining the grade channel corresponding to the evaluation grade of the meat product to be evaluated; Step 802: Mark the meat to be evaluated based on the grade channel to sort the meat to be evaluated into the grade channel.
[0098] The grade channel corresponding to the evaluation grade of the meat to be evaluated is determined, and the meat to be evaluated is marked based on the grade channel so that the meat to be evaluated can be sorted to the corresponding grade channel later.
[0099] In one embodiment, the marking of the grade of the meat to be evaluated may also include marking the evaluation grade of the meat to be evaluated. Figure 6 The evaluation process of meat marbling shown in the figure extracts the pattern parameters and meat parameters of the meat to be evaluated based on the target frame image in the video image of the meat to be evaluated, thereby determining the index value of each evaluation index of the meat to be evaluated and obtaining the evaluation index vector of the meat to be evaluated. Further, based on the evaluation standard array corresponding to each evaluation level in the preset evaluation system, traverse each evaluation standard vector or evaluation standard matrix in the evaluation standard array, match each evaluation standard vector or each evaluation standard matrix with the evaluation index vector, and determine whether there is a candidate level corresponding to the meat to be evaluated.
[0100] Furthermore, if there is no candidate grade corresponding to the meat to be evaluated, the meat to be evaluated is marked as an abnormal product. If there is a candidate grade corresponding to the meat to be evaluated, the evaluation index vector of the meat to be evaluated is matched with the evaluation standard vector or evaluation standard matrix corresponding to the candidate grade to determine whether the marbling of the meat to be evaluated meets the candidate grade. If the marbling of the meat to be evaluated meets the candidate grade, the evaluation grade of the meat to be evaluated is marked as the current candidate grade. If the marbling of the meat to be evaluated does not meet the candidate grade, the meat to be evaluated is downgraded. When downgrading, first determine whether the candidate grade currently corresponding to the meat to be evaluated is the lowest grade. If it is the lowest grade, the meat to be evaluated is marked as an abnormal product. If it is not the lowest grade, the meat to be evaluated is marked as the next grade of the current candidate grade.
[0101] According to the evaluation grade marked on the meat to be evaluated, the grade channel corresponding to the meat to be evaluated is determined, and then the meat to be evaluated is marked based on the grade channel for identification by the sorting device. Optionally, when the meat to be evaluated is sequentially conveyed to the entrance of each grade channel on the conveyor belt, the sorting device of each grade channel can determine whether to sort the meat to be evaluated according to the marked grade channel. Optionally, when the meat to be evaluated is conveyed to the entrance of the sorting channel on the conveyor belt, the sorting device can sort the meat to be evaluated according to the grade channel marked on the meat to be evaluated, and sort the meat to be evaluated to the corresponding grade channel.
[0102] In this embodiment, the pattern parameters of the meat to be evaluated are extracted through binarization processing and morphological filtering, which are used to calculate the index value of the evaluation index, obtain the corresponding evaluation index vector, and match the evaluation index vector of the meat to be evaluated with the evaluation standard array constructed based on the standard images of meat of each grade to determine the evaluation grade of the meat to be evaluated, thereby realizing automatic evaluation of the marbling grade of the meat. While improving the evaluation efficiency, it enhances the objectivity of the evaluation, avoids subjective evaluation differences, and thus improves the accuracy of the evaluation of the marbling grade of the meat.
[0103] Furthermore, through the automatic evaluation and grade labeling of the meat to be evaluated, the automatic sorting of the meat can be realized, which makes up for the vacancy of meat marbling in intelligent grading and sorting, and is conducive to improving the sorting efficiency of meat.
[0104] The meat marbling evaluation device provided by the present invention is described below. The meat marbling evaluation device described below and the meat marbling evaluation method described above can be referenced to each other.
[0105] Reference Figure 7 The meat marbling evaluation device provided by the embodiment of the present invention comprises: The parameter extraction module 10 is used to collect a video image of the meat to be evaluated, and extract pattern parameters of the marble pattern of the meat to be evaluated based on the video image; the pattern parameters include the pattern area, pattern perimeter and pattern quantity of the marble pattern; An index calculation module 20, used to determine the index value of each evaluation index corresponding to the meat product to be evaluated according to the pattern parameter, and obtain the evaluation index vector of the meat product to be evaluated; The grade evaluation module 30 is used to evaluate the marbling of the meat to be evaluated based on the evaluation index vector, and determine the evaluation grade corresponding to the meat to be evaluated.
[0106] In one embodiment, the grade evaluation module 30 is further used to: Matching the evaluation index vector with an evaluation standard array to determine a target standard vector that matches the evaluation index vector; Determining the evaluation level corresponding to the meat product to be evaluated according to the evaluation level corresponding to the target standard vector; Among them, the evaluation standard array is constructed based on the evaluation standard vector corresponding to each evaluation level, and the evaluation standard vector is composed of the standard index value of the evaluation index corresponding to each evaluation level, and the standard index value is calculated based on the pattern parameters extracted from the standard image of meat corresponding to each evaluation level.
[0107] In one embodiment, the parameter extraction module 10 is further used for: Extracting a target frame image from the video image, and performing threshold segmentation processing on the target frame image to obtain a binary template of a target interest area corresponding to the meat product to be evaluated; the target frame image is collected when the meat product to be evaluated is located in a preset detection area; Taking the area as a filtering parameter, after performing morphological filtering on the binary template, performing dot multiplication with the target frame image, a target object image of the meat to be evaluated is obtained; The pattern parameters of the marbling of the meat to be evaluated are extracted based on the target object image.
[0108] In one embodiment, the parameter extraction module 10 is further used for: Determine the minimum bounding rectangle of the meat to be evaluated based on the binary template, and cut the target image according to the minimum bounding rectangle to obtain an image of the region of interest of the meat to be evaluated; Binarizing the image of the region of interest to obtain a binary image of the region of interest; Performing a dot product on the interest region binary image and the interest region image to obtain a pattern binary image of each marble pattern in the target interest region; Constructing a label matrix of each marble pattern in the target area of interest according to the pattern binary image; the label serial number of the label matrix is used to represent the serial number of each marble pattern in the target area of interest; The pattern parameters of the marbling of the meat to be evaluated are extracted based on the label matrix.
[0109] In one embodiment, the indicator calculation module 20 is further used to: Extracting meat parameters of the meat to be evaluated from the video image; the meat parameters include meat area and meat circumference; Obtaining a conversion coefficient between a pixel area and an actual area, and calculating the index value of each evaluation index corresponding to the meat to be evaluated according to the conversion coefficient, the pattern parameter and the meat parameter, to obtain an evaluation index vector of the meat to be evaluated; The evaluation index includes at least one of pattern area ratio, pattern density, pattern diversity index, pattern uniformity index, pattern separation index, pattern shape index and pattern aggregation index.
[0110] In one embodiment, the indicator calculation module 20 is further used to: Acquire a reference image of a preset reference object; the reference image is acquired by collecting the reference object in a preset detection area, and the actual area of the reference object is a preset standard area; Performing color space conversion on the reference image to obtain a grayscale image; Performing filtering processing on the grayscale image to obtain a filtered image, and determining a segmentation threshold according to a pixel value of each pixel in the filtered image; Performing threshold segmentation on the filtered image based on the segmentation threshold to obtain a foreground binary image of a reference object interest area corresponding to the reference object; Performing morphological filtering on the foreground binary image to obtain a reference binary template; Counting the target number of pixel points corresponding to the reference object in the reference object binary template to obtain the pixel area of the reference object; The ratio of the pixel area of the reference object to the standard area is calculated to obtain a conversion coefficient between the pixel area and the actual area.
[0111] In one embodiment, the indicator calculation module 20 is further used to: Obtaining an evaluation system corresponding to the evaluation standard corresponding to the meat product to be evaluated; Determine each evaluation indicator corresponding to the evaluation system; The index value of each evaluation index is calculated according to the pattern parameters to obtain the index vector of the meat to be evaluated.
[0112] In one embodiment, the meat marbling evaluation device further comprises a grade marking module, which is used to: Determine the grade channel corresponding to the evaluation grade of the meat product to be evaluated; The meat products to be evaluated are marked based on the grade channels to sort the meat products to be evaluated into the grade channels.
[0113] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8As shown, the electronic device may include: a processor 810, a communications interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communications interface 820 and the memory 830 communicate with each other via the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the steps of the meat marbling evaluation method, for example including: Collecting a video image of the meat to be evaluated, and extracting pattern parameters of the marble pattern of the meat to be evaluated based on the video image; the pattern parameters include the pattern area, pattern perimeter and pattern quantity of the marble pattern; Determining the index values of the evaluation indexes corresponding to the meat product to be evaluated according to the pattern parameters, and obtaining the evaluation index vector of the meat product to be evaluated; Evaluate the marbling of the meat to be evaluated based on the evaluation index vector, and determine the evaluation grade corresponding to the meat to be evaluated; The step of evaluating the marbling of the meat to be evaluated based on the evaluation index vector and determining the evaluation grade corresponding to the meat to be evaluated includes: Matching the evaluation index vector with an evaluation standard array to determine a target standard vector that matches the evaluation index vector; Determining the evaluation level corresponding to the meat product to be evaluated according to the evaluation level corresponding to the target standard vector; Among them, the evaluation standard array is constructed based on the evaluation standard vector corresponding to each evaluation level, and the evaluation standard vector is composed of the standard index value of the evaluation index corresponding to each evaluation level, and the standard index value is calculated based on the pattern parameters extracted from the standard image of meat corresponding to each evaluation level.
[0114] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0115] On the other hand, the present invention further provides a computer program product, which includes a computer program. The computer program can be stored in a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the steps of the meat marbling evaluation method provided by the above methods, for example, including: Collecting a video image of the meat to be evaluated, and extracting pattern parameters of the marble pattern of the meat to be evaluated based on the video image; the pattern parameters include the pattern area, pattern perimeter and pattern quantity of the marble pattern; Determining the index values of the evaluation indexes corresponding to the meat product to be evaluated according to the pattern parameters, and obtaining the evaluation index vector of the meat product to be evaluated; Evaluate the marbling of the meat to be evaluated based on the evaluation index vector, and determine the evaluation grade corresponding to the meat to be evaluated; The step of evaluating the marbling of the meat to be evaluated based on the evaluation index vector and determining the evaluation grade corresponding to the meat to be evaluated includes: Matching the evaluation index vector with an evaluation standard array to determine a target standard vector that matches the evaluation index vector; Determining the evaluation level corresponding to the meat product to be evaluated according to the evaluation level corresponding to the target standard vector; Among them, the evaluation standard array is constructed based on the evaluation standard vector corresponding to each evaluation level, and the evaluation standard vector is composed of the standard index value of the evaluation index corresponding to each evaluation level, and the standard index value is calculated based on the pattern parameters extracted from the standard image of meat corresponding to each evaluation level.
[0116] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the meat marbling evaluation method provided by the above methods, for example, including: Collecting a video image of the meat to be evaluated, and extracting pattern parameters of the marble pattern of the meat to be evaluated based on the video image; the pattern parameters include the pattern area, pattern perimeter and pattern quantity of the marble pattern; Determining the index values of the evaluation indexes corresponding to the meat product to be evaluated according to the pattern parameters, and obtaining the evaluation index vector of the meat product to be evaluated; Evaluate the marbling of the meat to be evaluated based on the evaluation index vector, and determine the evaluation grade corresponding to the meat to be evaluated; The step of evaluating the marbling of the meat to be evaluated based on the evaluation index vector and determining the evaluation grade corresponding to the meat to be evaluated includes: Matching the evaluation index vector with an evaluation standard array to determine a target standard vector that matches the evaluation index vector; Determining the evaluation level corresponding to the meat product to be evaluated according to the evaluation level corresponding to the target standard vector; Among them, the evaluation standard array is constructed based on the evaluation standard vector corresponding to each evaluation level, and the evaluation standard vector is composed of the standard index value of the evaluation index corresponding to each evaluation level, and the standard index value is calculated based on the pattern parameters extracted from the standard image of meat corresponding to each evaluation level.
[0117] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0118] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for evaluating meat marbling, characterized in that: include: Collecting a video image of the meat to be evaluated, and extracting pattern parameters of the marbling of the meat to be evaluated based on the video image; The pattern parameters include the pattern area, pattern perimeter and pattern quantity of the marble pattern; Determining the index values of the evaluation indexes corresponding to the meat product to be evaluated according to the pattern parameters, and obtaining the evaluation index vector of the meat product to be evaluated; Evaluate the marbling of the meat to be evaluated based on the evaluation index vector, and determine the evaluation grade corresponding to the meat to be evaluated; The step of evaluating the marbling of the meat to be evaluated based on the evaluation index vector and determining the evaluation grade corresponding to the meat to be evaluated includes: Matching the evaluation index vector with an evaluation standard array to determine a target standard vector that matches the evaluation index vector; Determining the evaluation level corresponding to the meat product to be evaluated according to the evaluation level corresponding to the target standard vector; Among them, the evaluation standard array is constructed based on the evaluation standard vector corresponding to each evaluation level, and the evaluation standard vector is composed of the standard index value of the evaluation index corresponding to each evaluation level, and the standard index value is calculated based on the pattern parameters extracted from the standard image of meat corresponding to each evaluation level.
2. The meat marbling evaluation method according to claim 1, characterized in that: The step of extracting pattern parameters of the marbling of the meat to be evaluated based on the video image includes: Extracting a target frame image from the video image, and performing threshold segmentation processing on the target frame image to obtain a binary template of a target interest area corresponding to the meat product to be evaluated; the target frame image is collected when the meat product to be evaluated is located in a preset detection area; Taking the area as a filtering parameter, after performing morphological filtering on the binary template, performing dot multiplication with the target frame image, a target object image of the meat to be evaluated is obtained; The pattern parameters of the marbling of the meat to be evaluated are extracted based on the target object image.
3. The meat marbling evaluation method according to claim 2, characterized in that: The step of extracting pattern parameters of the marbling of the meat to be evaluated based on the target object image includes: Determine the minimum bounding rectangle of the meat to be evaluated based on the binary template, and cut the target image according to the minimum bounding rectangle to obtain an image of the region of interest of the meat to be evaluated; Binarizing the image of the region of interest to obtain a binary image of the region of interest; Performing a dot product on the interest region binary image and the interest region image to obtain a pattern binary image of each marble pattern in the target interest region; Constructing a label matrix of each marble pattern in the target area of interest according to the pattern binary image; the label serial number of the label matrix is used to represent the serial number of each marble pattern in the target area of interest; The pattern parameters of the marbling of the meat to be evaluated are extracted based on the label matrix.
4. The meat marbling evaluation method according to claim 1, characterized in that: The step of determining the index values of the evaluation indexes corresponding to the meat product to be evaluated according to the pattern parameters to obtain the evaluation index vector of the meat product to be evaluated includes: Extracting meat parameters of the meat to be evaluated from the video image; the meat parameters include meat area and meat circumference; Obtaining a conversion coefficient between a pixel area and an actual area, and calculating the index value of each evaluation index corresponding to the meat to be evaluated according to the conversion coefficient, the pattern parameter and the meat parameter, to obtain an evaluation index vector of the meat to be evaluated; The evaluation index includes at least one of pattern area ratio, pattern density, pattern diversity index, pattern uniformity index, pattern separation index, pattern shape index and pattern aggregation index.
5. The method for evaluating meat marbling according to claim 4, characterized in that: The step of obtaining a conversion coefficient between a pixel area and an actual area includes: Acquire a reference image of a preset reference object; the reference image is acquired by collecting the reference object in a preset detection area, and the actual area of the reference object is a preset standard area; Performing color space conversion on the reference image to obtain a grayscale image; Performing filtering processing on the grayscale image to obtain a filtered image, and determining a segmentation threshold according to a pixel value of each pixel in the filtered image; Performing threshold segmentation on the filtered image based on the segmentation threshold to obtain a foreground binary image of a reference object interest area corresponding to the reference object; Performing morphological filtering on the foreground binary image to obtain a reference binary template; Counting the target number of pixel points corresponding to the reference object in the reference object binary template to obtain the pixel area of the reference object; The ratio of the pixel area of the reference object to the standard area is calculated to obtain a conversion coefficient between the pixel area and the actual area.
6. The meat marbling evaluation method according to claim 1, characterized in that: The step of determining the index values of the evaluation indexes corresponding to the meat product to be evaluated according to the pattern parameters to obtain the evaluation index vector of the meat product to be evaluated includes: Obtaining an evaluation system corresponding to the evaluation standard corresponding to the meat product to be evaluated; Determine each evaluation indicator corresponding to the evaluation system; The index value of each evaluation index is calculated according to the pattern parameters to obtain the index vector of the meat to be evaluated.
7. The method for evaluating meat marbling according to claim 1, characterized in that: After evaluating the marbling of the meat to be evaluated based on the evaluation index vector and determining the evaluation grade corresponding to the meat to be evaluated, the method further includes: Determine the grade channel corresponding to the evaluation grade of the meat product to be evaluated; The meat products to be evaluated are marked based on the grade channels to sort the meat products to be evaluated into the grade channels.
8. A meat marbling evaluation device, characterized in that: include: A parameter extraction module, used to collect a video image of the meat to be evaluated, and extract pattern parameters of the marble pattern of the meat to be evaluated based on the video image; the pattern parameters include the pattern area, pattern perimeter and pattern quantity of the marble pattern; An index calculation module, used to determine the index value of each evaluation index corresponding to the meat product to be evaluated according to the pattern parameter, and obtain the evaluation index vector of the meat product to be evaluated; A grade evaluation module, used to evaluate the marbling of the meat to be evaluated based on the evaluation index vector, and determine the evaluation grade corresponding to the meat to be evaluated; The grade evaluation module is also used for: Matching the evaluation index vector with an evaluation standard array to determine a target standard vector that matches the evaluation index vector; Determining the evaluation level corresponding to the meat product to be evaluated according to the evaluation level corresponding to the target standard vector; Among them, the evaluation standard array is constructed based on the evaluation standard vector corresponding to each evaluation level, and the evaluation standard vector is composed of the standard index value of the evaluation index corresponding to each evaluation level, and the standard index value is calculated based on the pattern parameters extracted from the standard image of meat corresponding to each evaluation level.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the meat marbling evaluation method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the meat marbling evaluation method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Machine vision-based real-time detection and grading method and machine vision-based real-time detection and grading device for pork appearance quality
CN101561402A
Beef marbling grade scoring method and device
CN101706445A
Rational burying depth calculation method for constructing subsea tunnel by shield method
CN108647473A
Dynamic downsampling image segmentation method
CN110084818A
Analysis method and system for big data pattern
CN113256148A