Intelligent detection method for unhairing of live pigs

By analyzing the grayscale image and visible image feature of the pig skin surface, the accuracy of residual pig hair detection is solved, and efficient identification and processing of residual pig hair on the pig skin surface is achieved.

CN120374614AActive Publication Date: 2025-07-25XIAN BENBEN ANIMAL HUSBANDRY CO LTD
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202510855731.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-07-25
Estimated Expiration
2045-06-25

AI Technical Summary

Technical Problem

The prior art is difficult to accurately detect whether there are residual pig hair on the pig skin surface after hair removal treatment, which may lead to food safety and hygiene problems.

Method used

By obtaining the grayscale image of the pig skin surface, using the characteristic values of pixel points and clustering analysis, combining the color characteristics of the visible image, the probability value of residual pig hair is determined to realize the detection of the outer surface of the pig skin.

Benefits of technology

It can accurately identify and distinguish residual pig hair from pig skin texture or folds, improve the accuracy and reliability of detection, and ensure the hygiene and appearance of raw pork.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120374614A_ABST
    Figure CN120374614A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image data processing, in particular to an intelligent detection method for live pig unhairing. The method comprises the following steps: determining a first characteristic value of a target pixel point in a gray image of the outer surface of the pigskin subjected to unhairing treatment; determining a second characteristic value of the target pixel point, and taking a product of the first characteristic value and the second characteristic value as a third characteristic value; determining a target line taking the target pixel point as a starting point from the grayscale image, and obtaining a consistency value of the pixel area of the target line and the area of the minimum bounding rectangle; according to the product of the third characteristic value and the consistency value, determining the probability value of the target pixel point belonging to the residual pig hair; and according to the probability values of the pixel points and the color features of the pixel points in the visible light image of the outer surface of the pigskin, clustering the pixel points in the grayscale image to obtain a detection result of the residual pig hair. According to the technical scheme, whether residual pig hair exists on the surface of the live pig subjected to hair removal treatment or not can be accurately determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of image data processing, and particularly to an intelligent detection method for pig hair removal. Background Art

[0002] Pig hair may carry contaminants such as bacteria and parasites. During the slaughter, processing, and transportation of raw pork, the bacteria and parasites in pig hair may fall off and contaminate the meat, affecting food safety and consumer health. Moreover, pig hair may have an unpleasant odor, affecting the taste and flavor of the processed pork. Therefore, it is necessary to remove the pig hair present on the surface of pork.

[0003] Methods such as tumbling hair removal, scalding hair removal, flame hair removal, and chemical hair removal can be used to achieve the hair removal of pig hair on the outer surface of the pigskin of raw pork.

[0004] For example, chemical agents such as sodium hydroxide solution can be used to soak pigs to dissolve and remove pig hair; alternatively, a tumbler with rubber protrusions or chains can be used to remove the pig hair present on the surface of pigs through mechanical friction; or, pigs can be soaked in hot water to expand the hair follicles of the pigs, thereby loosening the pig hair on the surface of the pigs, and the pig hair present on the surface of the pigs can be removed mechanically.

[0005] After the hair removal of the pig hair present on the surface of pigs is completed, there may still be some residual pig hair on the surface of the pigs. The residual pig hair may still carry contaminants such as bacteria and parasites. The residual pig hair may cause allergic reactions in some people, and the residual pig hair will affect the cleanliness and appearance of the pork surface. Therefore, it is necessary to detect the pigs after hair removal to determine whether there is residual pig hair on the surface of the pigs after hair removal. Summary of the Invention

[0006] To determine whether there are residual pig hairs on the surface of a pig after hair removal treatment, the present application provides an intelligent detection method for pig hair removal, including: obtaining a grayscale image of the outer surface of the pigskin after hair removal treatment, and determining a first eigenvalue of a target pixel point in the grayscale image; the first eigenvalue is at least used to characterize the difference between the average grayscale value of the grayscale image and the grayscale value of the target pixel point; determining a target line starting from the target pixel point in the grayscale image, and obtaining a consistency value between the pixel area of the target line and the area of the minimum circumscribed rectangle of the target line; the difference in grayscale values between adjacent pixel points on the target line is less than a preset difference threshold; determining a second eigenvalue of the target pixel point; the second eigenvalue is used to characterize the smoothness of the change in grayscale values within the neighborhood range of the target pixel point, and determining the probability value that the target pixel point belongs to residual pig hair according to the product of the first eigenvalue, the second eigenvalue, and the consistency value; clustering the pixel points in the grayscale image according to the probability values of the pixel points in the grayscale image and the color characteristics of the pixel points in the visible light image of the outer surface of the pigskin, and determining the detection result of the residual pig hair on the outer surface of the pigskin according to the clustering result.

[0007] In this way, by using the probability value that a pixel point belongs to residual pig hair and the color characteristics of the pixel point in the visible light image of the pigskin for clustering, the residual pig hair can be more accurately determined from the outer surface of the pigskin after hair removal treatment.

[0008] Optionally, the first eigenvalue of the target pixel point is determined in the following manner: , where T is the first eigenvalue of the target pixel point, norm is a normalization processing function, is the grayscale value of the target pixel point, is the average grayscale value of the grayscale image, exp is an exponential function with the natural constant as the base, and R is the variance of the grayscale values of the pixel points within the neighborhood range of the target pixel point.

[0009] In this way, since the variance of the grayscale values within the neighborhood range of the pixel points with noise is larger, the influence of noise in the grayscale image can be avoided through the first eigenvalue of the target pixel point.

[0010] Optionally, the second eigenvalue of the target pixel point is determined in the following manner: , where D is the second eigenvalue of the target pixel point; F is the information entropy of the grayscale values of the pixel points within the neighborhood range of the target pixel point, and the information entropy is used to characterize the complexity of the grayscale values of the pixel points within the neighborhood range; is a second preset positive number, exp is an exponential function with the natural constant as the base, and M is the range of the grayscale values of the pixel points within the neighborhood range of the target pixel point.

[0011] In this way, by comparing the information entropy of the gray values in the neighborhood range with the range of values of the pixel points in the neighborhood range, the second eigenvalue can reflect the gradual change characteristics of the pixel points within the neighborhood range of the target pixel point.

[0012] Optionally, the information entropy is determined in the following manner: , where F is the information entropy, n is the number of types of gray values of the pixel points within the neighborhood range of the target pixel point, is the proportion of the frequency of occurrence of the i-th type of gray value within the neighborhood range of the target pixel point, is the logarithmic function with the natural constant as the base.

[0013] Optionally, the target line starting from the target pixel point is determined in the following manner: The pixel point within the neighborhood range of the target pixel point with the smallest difference in gray value from the target pixel point is used as the first extended pixel point; among the pixel points within the neighborhood range of the first extended pixel point, the pixel points with a difference in gray value from the first extended pixel point less than a preset difference threshold are used as the next extended pixel points; when the differences in gray value between the pixel points within the neighborhood range of the extended pixel points and the extended pixel points are all greater than or equal to the preset difference threshold, the determination of the extended pixel points is stopped, and all the extended pixel points are connected to obtain the target line corresponding to the target pixel point.

[0014] In this way, by determining the extended pixel points with the same or similar gray value as the target pixel point starting from the target pixel point, multiple extended pixel points can be obtained, which can facilitate the use of the target line to determine whether the target pixel point belongs to residual pig hair.

[0015] Optionally, the consistency value corresponding to the target pixel point is determined in the following manner: , where W is the consistency value corresponding to the target pixel point, exp is the exponential function with the natural constant as the base, is the pixel area of the target line corresponding to the target pixel point, is the area of the minimum circumscribed rectangle of the target line corresponding to the target pixel point, is the first preset positive number.

[0016] In this way, due to the different shape characteristics of the target lines determined by the residual pig hair or the wrinkles of the pig skin, by using the consistency between the pixel area of the target line and the area of the minimum circumscribed rectangle of the target line, the difference between the residual pig hair and the wrinkled part or the textured part of the pig skin can be realized.

[0017] Optionally, determining the probability value that the target pixel point belongs to residual pig hair according to the product of the third eigenvalue and the consistency value includes: using the product of the third eigenvalue and the consistency value as the target product, and taking the result of normalizing the target product as the probability value that the target pixel point belongs to residual pig hair.

[0018] Optionally, clustering the pixel points in the grayscale image includes: using the pixel values of the target pixel point in the red channel, green channel, and blue channel of the visible light image on the outer surface of the pigskin as the first clustering dimension, the second clustering dimension, and the third clustering dimension of the target pixel point in sequence; performing mean shift clustering on the pixel points in the grayscale image according to the probability values, the first clustering dimension, the second clustering dimension, and the third clustering dimension of the pixel points in the grayscale image.

[0019] Optionally, the clustering result includes multiple clustering clusters. Determining the detection result of the residual pig hairs on the outer surface of the pigskin according to the clustering result includes: taking the average value of the probability values of all pixel points in the clustering cluster as the evaluation value of the clustering cluster; taking the clustering cluster with an evaluation value greater than the preset probability threshold as the target clustering cluster where the residual pig hairs are located; taking the area composed of the pixel points included in the target clustering cluster as the target defect area where the residual pig hairs are located.

[0020] Optionally, the method further includes: when the detection result indicates that there are residual pig hairs on the outer surface of the pigskin, controlling the pig hair processing device to perform hair removal processing on the outer surface of the pigskin again.

[0021] The technical solution provided by the embodiments of the present application may include the following beneficial effects: For the target pixel points in the grayscale image of the outer surface of the pigskin after hair removal treatment, a target line starting from the target pixel point can be determined, and the difference in grayscale values between adjacent pixel points on the target line is less than the preset difference threshold; Since the shape characteristics of the target lines of the pixel points of the pig hairs and other areas other than the pig hairs on the surface of the pork are different, by obtaining the consistency value of the pixel area of the target line and the area of the minimum circumscribed rectangle of the target line, and combining the determined first eigenvalue and second eigenvalue, the probability that the target pixel point belongs to the residual pig hairs can be evaluated more comprehensively; Using the probability values and color characteristics of the pixel points for clustering can obtain a more accurate detection result of the residual pig hairs on the outer surface of the pigskin.

[0022] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a flowchart of an intelligent detection method for pig hair removal according to an exemplary embodiment. DETAILED DESCRIPTION

[0024] First, a brief introduction to the application scenario of the embodiments of the present application is given. In the application scenario of the present application, after the hair removal treatment of the pig hair on the surface of the live pig, there may be some residual pig hair on the surface of the live pig. The residual pig hair will affect the hygiene and appearance of the pork. Therefore, it is necessary to detect the surface of the pork after the hair removal treatment to determine whether there is residual pig hair on the surface of the pork after the hair removal treatment.

[0025] In view of the above technical problems, the embodiments of the present application provide an intelligent detection method for pig hair removal. Figure 1 It is a flowchart of an intelligent detection method for pig hair removal shown according to an exemplary embodiment, as Figure 1 shown, and the method includes the following steps.

[0026] In step S101, a grayscale image of the outer surface of the pigskin after the hair removal treatment is obtained, and a first eigenvalue of the target pixel point in the grayscale image is determined.

[0027] In order to avoid the adverse effects of possible stains on the outer surface of the pigskin on the subsequent detection results, the surface of the live pig to be detected can be pre-cleaned.

[0028] An image acquisition device can be used to obtain a visible light image of the outer surface of the pigskin after the hair removal treatment, and a grayscale image can be obtained through the grayscale processing of the visible light image; the grayscale image of the outer surface of the pigskin may include the surface texture of the pigskin, the wrinkles of the pigskin, and the residual pig hair due to incomplete hair removal treatment, etc.

[0029] The reflection ability of pig hair and pigskin to light is different, and there are also certain differences in the color characteristics of pig hair and pigskin itself. Moreover, after the hair removal treatment of the outer surface of the pigskin of the live pig, most of the pig hair on the outer surface of the pigskin of the live pig has been removed. Compared with the pixel points corresponding to the pigskin itself in the grayscale image, the number of residual pig hair that may exist in the grayscale image is less, and the difference between the residual pig hair and the pixel points corresponding to the pigskin itself in the grayscale image is more obvious.

[0030] The target pixel point can be any one of all the pixel points in the grayscale image; the first eigenvalue is at least used to characterize the difference between the average grayscale value of the grayscale image and the grayscale value of the target pixel point; the average grayscale value of the grayscale image can reflect the overall grayscale value of the surface of the pigskin. Since the number of pig hair on the surface of the pigskin after the hair removal treatment is less, the greater the difference between the grayscale value of the target pixel point and the average grayscale value of the entire grayscale image, the more likely the target pixel point is located at the position where the residual pig hair is located.

[0031] In one embodiment, the first eigenvalue of the target pixel point is determined by the following method: , where T is the first eigenvalue of the target pixel, norm is the normalization function, is the gray value of the target pixel, is the average gray value of the grayscale image, exp is the exponential function with the natural constant as the base, and R is the variance of the gray values of the pixels within the neighborhood range of the target pixel.

[0032] In the grayscale image of the outer surface of the pigskin after hair removal treatment, for the pixels corresponding to the pigskin texture, residual pig hair or pigskin wrinkles in the grayscale image, there are usually other pixels of the same type within the neighborhood range.

[0033] For example, for a certain pixel corresponding to residual pig hair in the grayscale image, due to the continuity of the pig hair, there are usually other pixels corresponding to pig hair within the neighborhood range of the pixels corresponding to pig hair.

[0034] In the grayscale image of the outer surface of the pigskin after hair removal treatment, there may be some noise pixels. The positions of these noise pixels in the grayscale image are scattered, and they may appear at different positions in the grayscale image, and the pixel values of the noise pixels are random.

[0035] For the possible noise pixels in the grayscale image, due to the randomness and dispersion of the noise pixels, there are usually no other pixels with the same or similar gray values within the neighborhood range of the noise pixels, resulting in a larger variance of the gray values of the pixels within the neighborhood range of the noise pixels.

[0036] Compared with the possible noise pixels in the grayscale image, the variance of the gray values within the neighborhood range of the pixels corresponding to pig hair in the grayscale image is smaller. Therefore, a larger first eigenvalue can be determined than that of the noise pixels, realizing the distinction between the noise pixels and the non-noise pixels, and avoiding the influence of the possible noise in the grayscale image on the detection result.

[0037] Since the residual pig hair is more prominent in the entire grayscale image, the difference between the gray value of the pixel corresponding to pig hair in the grayscale image and the average gray value of the entire grayscale image is larger. Therefore, the greater the difference between the gray value of the target pixel and the average gray value of the entire grayscale image, the more likely the target pixel corresponds to the residual pig hair that may exist on the outer surface of the pigskin.

[0038] In this way, through the first eigenvalue of the target pixel, it can not only reflect the probability that the target pixel belongs to the possible residual pig hair in the grayscale image, but also avoid the influence of the possible noise pixels in the grayscale image.

[0039] In step S103, determine the second eigenvalue of the target pixel, and use the product of the first eigenvalue and the second eigenvalue as the third eigenvalue.

[0040] The second eigenvalue is used to characterize the smoothness of the change in gray values within the neighborhood range of the target pixel; there may be some image regions on the outer surface of raw pork with the same or similar gray values as the remaining pig hairs. However, the change in gray values of the pixel points within these image regions with the same or similar gray values as the pig hairs is different from the change in gray values of the pixel points within the region where the pig hairs are located. Therefore, the remaining pig hairs, as well as the parts with the same or similar gray values as the remaining pig hairs but not belonging to the pig hairs, can be distinguished by the second eigenvalue.

[0041] In one embodiment, the second eigenvalue of the target pixel is determined in the following manner: , where D is the second eigenvalue of the target pixel; F is the information entropy of the gray values of the pixel points within the neighborhood range of the target pixel, and the information entropy is used to characterize the complexity of the gray values of the pixel points within the neighborhood range; is the second preset positive number, exp is the exponential function with the natural constant as the base, and M is the range of the gray values of the pixel points within the neighborhood range of the target pixel.

[0042] The range of the gray values of the pixel points within the neighborhood range of the target pixel can reflect the contrast of the pixel points within the neighborhood range of the target pixel; compared with the parts on the surface of raw pork with gray values similar to those of the pig hairs but not belonging to the pig hairs, the remaining pig hairs have a higher gradual change in gray values in the gray image. Therefore, the second eigenvalue can exclude the influence of the parts in the gray image with gray value manifestations similar to those of the remaining pig hairs but actually not belonging to the remaining pig hairs.

[0043] The information entropy of the gray values of the pixel points within the neighborhood range of the target pixel can characterize the complexity of the gray values of the pixel points within the neighborhood range; within the neighborhood range of the target pixel, if the complexity of the gray values of the pixel points is relatively high and the range of the gray values of the pixel points is smaller, it indicates that the change in the gray values of the pixel points within the neighborhood range of the target pixel is more in line with the gradual change characteristics of the remaining pig hairs.

[0044] The second preset positive number can be a relatively small positive number such as 0.01 or 0.02 compared to 1. The second preset positive number is used to ensure that at least two parts multiplied in the second eigenvalue are greater than 0, avoiding the situation where the calculation is meaningless due to at least one of the two parts multiplied being 0.

[0045] When the range of the gray values of the pixel points within the neighborhood of the target pixel point is the same, the lower the gradual change of the gray values of the pixel points within the neighborhood range will result in fewer types of gray values of the pixel points within the neighborhood range under the same range, and the neighborhood range with fewer types may correspond to a smaller information entropy, making the value of the second eigenvalue smaller. Therefore, the second eigenvalue can better characterize the degree of gradual change of the gray values within the neighborhood of the pixel point.

[0046] In this way, by comparing the information entropy of the gray values within the neighborhood range and the range of the pixel points within the neighborhood, the obtained second eigenvalue can reflect the gradual change characteristics of the pixel points within the neighborhood of the target pixel point, thereby evaluating the degree or probability that the target pixel point belongs to residual pig hair.

[0047] In one embodiment, the information entropy is determined by the following method: , where F is the information entropy, n is the number of types of gray values of the pixel points within the neighborhood of the target pixel point, is the proportion of the frequency of occurrence of the i-th type of gray value within the neighborhood of the target pixel point, is the logarithmic function with the natural constant as the base.

[0048] The proportion of the frequency of occurrence of the gray values within the neighborhood of the target pixel point is a positive number less than 1. Therefore, the logarithmic operation result of the proportion of the frequency by the logarithmic function with the natural constant as the base is less than 0. The negative sign existing in the calculation formula of the information entropy can ensure that the obtained value of the information entropy is positive.

[0049] The more types of gray values that appear within the neighborhood of the target pixel point, or the greater the difference in the proportion of the frequency of different gray values, the greater the information entropy of the gray values within the neighborhood of the target pixel point. Therefore, the information entropy can better characterize the complexity of the gray values of the pixel points within the neighborhood of the target pixel point.

[0050] Since the first eigenvalue can reflect the difference between the target pixel point and the overall gray values of all pixel points in the gray image, and the first eigenvalue can avoid the influence of possible noise pixel points in the gray image; the second eigenvalue can distinguish between the residual pig hair in the gray image and the pixel points that have a similar gray appearance to the residual pig hair but do not belong to the residual pig hair.

[0051] Taking the product of the first eigenvalue and the second eigenvalue as the third eigenvalue, the third eigenvalue can better integrate the functions of the first eigenvalue and the second eigenvalue, so as to better determine the image area where the residual pig hair is located from the gray image using the third eigenvalue.

[0052] In step S103, a target line starting from the target pixel point is determined from the grayscale image, and a consistency value between the pixel area of the target line and the area of the minimum circumscribed rectangle of the target line is obtained.

[0053] The difference in grayscale value between adjacent pixels on the target line is less than a preset difference threshold.

[0054] Since the pig hair in the raw pig skin has been depilated, the residual pig hair is more isolated in the outer skin of the raw pig, so that in the grayscale image of the outer surface of the depilated raw pig skin, the residual pig hair appears as a continuous single line. Since the difference in grayscale value between adjacent pixels on the target line is less than the preset difference threshold, when the target pixel is the pixel corresponding to the residual pig hair, the obtained target line is usually a simpler single line.

[0055] In the grayscale image of the outer surface of the depilated pig skin, the characteristics of the texture part of the pig skin are more diverse than those of the residual pig hair. The texture part of the pig skin may appear as more complex tree-like lines or mesh lines; or, there may be some wrinkled parts on the surface of the pig skin, and these wrinkled parts usually also appear as tree-like lines.

[0056] Since the difference in grayscale value between adjacent pixels on the target line is less than the preset difference threshold, when the target pixel is a pixel corresponding to the pig skin texture part or the wrinkled part, the obtained target line is usually a more complex tree-like or mesh-like line.

[0057] Since the line features of the residual pig hair are simpler, when the target pixel corresponds to the residual pig hair, the outer contour features of the target line corresponding to the target pixel are more consistent with the minimum circumscribed rectangle of the target line.

[0058] Since the line features of the pigskin texture or wrinkle part are more complex, when the target pixel point corresponds to the pigskin texture or wrinkle part, the outer contour features of the target line corresponding to the target pixel point are more different from the minimum circumscribed rectangle of the target line.

[0059] Since the shape characteristics of the residual pig hair that may exist on the surface of the raw pig skin are simpler, and the line characteristics of the texture part or the wrinkled part of the pig skin are more complex, therefore, obtaining the consistency value between the pixel area of the target line and the area of the minimum circumscribed rectangle of the target line can facilitate the determination of the possible residual pig hair from the grayscale image through the consistency value.

[0060] In one embodiment, the target line starting from the target pixel is determined as follows: The pixel with the smallest difference in gray value from the target pixel within the neighborhood range of the target pixel is used as the first extended pixel; the pixels within the neighborhood range of the first extended pixel that have a difference in gray value from the first extended pixel less than a preset difference threshold are used as the next extended pixels; when the difference in gray value between the pixels within the neighborhood range of the extended pixel and the extended pixel is greater than or equal to the preset difference threshold, the determination of the extended pixel is stopped, and all the extended pixels are connected to obtain the target line corresponding to the target pixel.

[0061] The size of the neighborhood range can be ranges such as 3×3, 5×5, and 7×7, etc.; the preset difference threshold can be set according to actual needs. For example, the preset difference threshold can be between 5 and 20, and two adjacent pixels with a gray value difference within 5 can be classified into the same target line.

[0062] For the target pixel in the grayscale image, if there are other pixels within the neighborhood range of the target pixel that have a relatively small difference in gray value from the target pixel, then the pixel with the smallest difference in gray value from the target pixel among the other pixels within the neighborhood range that have a relatively small difference in gray value from the target pixel can be used as the first extended pixel of the target pixel.

[0063] On the contrary, since pig hairs are usually continuous single lines, if there are no other pixels within the neighborhood range of the target pixel that have a relatively small difference in gray value from the target pixel, it indicates that the target pixel has a high probability of corresponding to other parts of the pigskin other than the remaining pig hairs, and a smaller consistency value can be determined for the target pixel. For example, the consistency value corresponding to the target pixel can be set to 0.

[0064] Since the length of pig hairs is usually within a certain range, and to avoid the determination time of the target line being too long due to the excessive length of the determined target line, when the number of obtained extended pixels is greater than or equal to a preset number threshold, the target line is determined based on the obtained extended pixels, and the determination process of the extended pixels is stopped.

[0065] In this way, starting from the target pixel, by determining the extended pixels with the same or similar gray value as the target pixel and obtaining multiple extended pixels, the difference in gray value between adjacent pixels can be within the preset difference threshold, so as to use the target line to determine whether the target pixel is on the remaining pig hairs.

[0066] In one embodiment, the consistency value corresponding to the target pixel is determined as follows: , where W is the consistency value corresponding to the target pixel point, exp is the exponential function with the natural constant as the base, is the pixel area of the target line corresponding to the target pixel point, is the area of the minimum bounding rectangle of the target line corresponding to the target pixel point, is the first preset positive number.

[0067] The closer it is to 1, the closer the pixel area of the target line corresponding to the target pixel point is to the area of the minimum bounding rectangle of the target line corresponding to the target pixel point. And because the pixel area of the hair of the pig is more consistent with the area of the minimum bounding rectangle, a larger consistency value can be determined for the pixel points belonging to the hair of the pig, and a smaller consistency value can be determined for the pixel points belonging to the pigskin texture or fold part in the pigskin, so as to distinguish the pixel points where the residual hair is located in the grayscale image from the pixel points belonging to the pigskin texture or fold part.

[0068] The first preset positive number can be a relatively small value such as 0.01 or 0.02 relative to 1. The first preset positive number is used to make the value for the exponential operation at least greater than 0.

[0069] Through the processing of the reciprocal of the exponential function, the obtained consistency value can be in the range of 0 to 1, so as to facilitate the comparison and calculation between variables.

[0070] In this way, by comparing the consistency between the pixel area of the target line corresponding to the target pixel point and the area of the minimum bounding rectangle of the target line corresponding to the target pixel point, a larger consistency value can be determined for the pixel points in the grayscale image that are more likely to belong to the residual hair, so as to realize the detection of the residual hair in the grayscale image.

[0071] In step S104, according to the product of the third eigenvalue and the consistency value, determine the probability value that the target pixel point belongs to the residual hair; according to the probability value of the pixel points in the grayscale image and the color characteristics of the pixel points in the visible light image on the outer surface of the pigskin, cluster the pixel points in the grayscale image, and determine the detection result of the residual hair on the outer surface of the pigskin according to the clustering result.

[0072] In one embodiment, determining the probability value that the target pixel point belongs to the residual hair according to the product of the third eigenvalue and the consistency value includes: taking the product of the third eigenvalue and the consistency value as the target product, and taking the normalization processing result of the target product as the probability value that the target pixel point belongs to the residual hair.

[0073] The product of the third eigenvalue and the consistency value is used as the target product. The target product can synthesize the third eigenvalue and the consistency value, enabling the target product to more comprehensively characterize the probability that the target pixel belongs to residual pig hair.

[0074] Normalizing the target product can facilitate subsequent comparison and calculation between variables. Among them, the normalization process performed on the target product can be implemented using the maximum-minimum method.

[0075] The probability value of a pixel point in a grayscale image is determined based on the gradient degree of the grayscale values within the neighborhood range of the pixel point, the shape characteristics of the target line corresponding to the pixel point, and the grayscale value of the pixel point. The probability value of the pixel point can distinguish between residual pig hair and pigskin wrinkles or texture parts on the outer skin of raw pork. Therefore, based on the probability value of the pixel point in the grayscale image and the color characteristics of the pixel point in the visible light image, it is possible to more accurately determine the possible residual pig hair on the outer skin of raw pork.

[0076] For a target pixel point in a grayscale image, the color characteristics of the target pixel point in the visible light image on the outer surface of the pigskin can be determined according to the pixel values of the pixel point corresponding to the target pixel point in the visible light image on the outer surface of the pigskin in the red, green, and blue channels respectively.

[0077] In one embodiment, clustering the pixel points in the grayscale image includes: taking the pixel values of the target pixel point in the red channel, green channel, and blue channel of the visible light image on the outer surface of the pigskin in the grayscale image as the first clustering dimension, the second clustering dimension, and the third clustering dimension of the target pixel point in sequence; performing mean shift clustering on the pixel points in the grayscale image according to the probability value of the pixel point in the grayscale image, the first clustering dimension, the second clustering dimension, and the third clustering dimension.

[0078] Since the visible light image of the outer surface of the raw pigskin records the color characteristics of different parts of the raw pigskin, and there are certain differences between the color characteristics of the residual pig hair on the raw pigskin and the color characteristics of other parts of the raw pigskin, taking the pixel values of the target pixel point in the red channel, green channel, and blue channel of the visible light image on the outer surface of the pigskin in the grayscale image as different clustering dimensions can determine the area where the residual pig hair is located after clustering.

[0079] When performing mean shift clustering on the pixel points in the grayscale image, the probability value that the pixel point belongs to residual pig hair is considered. Therefore, after clustering, pixel points with the same or similar color characteristics can be clustered outside the same clustering cluster, and pixel points with the same or similar probability of belonging to residual pig hair can also be clustered into the same clustering cluster, so as to determine the location of the residual pig hair from the obtained multiple clustering clusters.

[0080] Mean shift clustering is a non-parametric clustering algorithm based on kernel density estimation. Pixel points in an image can be clustered into different regions through mean shift clustering, thereby realizing image segmentation.

[0081] In the embodiments of the present application, since the clustering process of pixel points in a grayscale image is determined according to the color features of pixel points in a visible light image and the probability value that the pixel points belong to residual pig hairs, pixel points with the same or similar color features and probability values belonging to residual pig hairs can be clustered into the same image region.

[0082] In this way, through the clustering of pixel points in the grayscale image, it is convenient to determine the image region where the residual pig hairs are located according to the obtained clustering clusters.

[0083] In one embodiment, the clustering result includes multiple clustering clusters. Determining the detection result of residual pig hairs on the outer surface of a pigskin according to the clustering result includes: taking the average value of the probability values of all pixel points in the clustering cluster as the evaluation value of the clustering cluster; taking the clustering cluster with an evaluation value greater than a preset probability threshold as the target clustering cluster where the residual pig hairs are located; taking the region composed of the pixel points included in the target clustering cluster as the target defect region where the residual pig hairs are located.

[0084] Since the probability value of a pixel point can represent the probability that the pixel point belongs to residual pig hairs, for the clustering clusters obtained after clustering, clustering of pixel points with similar features is achieved. The average value of the probability values of all pixel points in the clustering cluster can reflect the probability that the clustering cluster belongs to the region where the residual pig hairs are located. Therefore, taking the average value of the probability values of all pixel points in the clustering cluster as the evaluation value of the clustering cluster can facilitate determining the image region where the residual pig hairs are located from all clustering clusters.

[0085] The preset probability threshold can be set according to actual needs. For example, the preset probability threshold can be between 0.6 and 0.7; taking the clustering cluster with an evaluation value greater than the preset probability threshold as the target clustering cluster where the residual pig hairs are located realizes the determination of the region where the residual pig hairs are located, and can facilitate the treatment of the residual pig hairs on the surface of the pigskin after the dehairing process.

[0086] In one embodiment, when the detection result indicates that there are residual pig hairs on the outer surface of the pigskin, the pig hair treatment device can be controlled to perform the dehairing treatment on the outer surface of the pigskin again.

[0087] When the detection result indicates that there are residual pig hairs on the outer surface of the pigskin, performing the dehairing treatment on the outer surface of the pigskin again can ensure the hygiene and appearance of the surface of the pigskin.

[0088] In order to improve the processing efficiency of residual pig hairs, the pig hair processing device can be controlled to perform hair removal processing on the target defect area where the residual pig hairs are located.

[0089] It should be understood that the present application is not limited to the exact structures already described and shown in the drawings, and various modifications and changes can be made without departing from its scope.

Claims

1. An intelligent detection method for pig hair removal, characterized in that, Including: Obtain a grayscale image of the outer surface of the depilated pigskin, and determine the first eigenvalue of the target pixel points in the grayscale image; The first eigenvalue is at least used to characterize the difference between the average grayscale value of the grayscale image and the grayscale value of the target pixel points; Determine the second eigenvalue of the target pixel points, and take the product of the first eigenvalue and the second eigenvalue as the third eigenvalue; The second eigenvalue is used to characterize the smoothness of the change in grayscale values within the neighborhood range of the target pixel points; Determine a target line starting from the target pixel points in the grayscale image, and obtain the consistency value between the pixel area of the target line and the area of the minimum circumscribed rectangle of the target line; the difference in grayscale values between adjacent pixel points on the target line is less than a preset difference threshold; Determine the probability value that the target pixel points belong to residual pig hairs according to the product of the third eigenvalue and the consistency value; according to the probability values of the pixel points in the grayscale image and the color characteristics of the pixel points in the visible light image of the outer surface of the pigskin, cluster the pixel points in the grayscale image, and determine the detection result of the residual pig hairs on the outer surface of the pigskin according to the clustering result.

2. The intelligent detection method for pig hair removal according to claim 1, wherein, The first eigenvalue of the target pixel points is determined in the following manner: , where T is the first eigenvalue of the target pixel, norm is the normalization function, is the gray value of the target pixel, is the average gray value of the gray image, exp is the exponential function with the natural constant as the base, and R is the variance of the gray values of the pixels within the neighborhood range of the target pixel.

3. The intelligent detection method for pig hair removal according to claim 1, wherein The second eigenvalue of the target pixel points is determined in the following manner: , where D is the second eigenvalue of the target pixel; F is the information entropy of the gray values of the pixels within the neighborhood range of the target pixel, and the information entropy is used to characterize the complexity of the gray values of the pixels within the neighborhood range; is a second preset positive number, exp is the exponential function with the natural constant as the base, and M is the range of the gray values of the pixels within the neighborhood range of the target pixel.

4. The intelligent detection method for pig hair removal according to claim 3, characterized in that, The information entropy is determined in the following manner: , where F is the information entropy, n is the number of types of gray values of the pixels within the neighborhood range of the target pixel point, is the proportion of the frequency of occurrence of the i-th gray value within the neighborhood range of the target pixel point, is the logarithmic function with the natural constant as the base.

5. The intelligent detection method for pig hair removal according to claim 1, characterized in that, The target line starting from the target pixel points is determined in the following manner: Take the pixel point with the smallest difference in grayscale value from the target pixel points within the neighborhood range of the target pixel points as the first extended pixel point; Take the pixel points with a difference in grayscale value less than the preset difference threshold from the first extended pixel point within the neighborhood range of the first extended pixel point as the next extended pixel point; In the case where the difference in grayscale value between the pixel points within the neighborhood range of the extended pixel points and the extended pixel points is greater than or equal to the preset difference threshold, stop determining the extended pixel points, and connect all the extended pixel points to obtain the target line corresponding to the target pixel points.

6. The intelligent detection method for pig hair removal according to claim 1, characterized in that, The consistency value corresponding to the target pixel points is determined in the following manner: , where W is the consistency value corresponding to the target pixel point, exp is the exponential function with the natural constant as the base, is the pixel area of the target line corresponding to the target pixel point, is the area of the minimum circumscribed rectangle of the target line corresponding to the target pixel point, is the first preset positive number.

7. The intelligent detection method for pig hair removal according to claim 1, wherein Determine the probability value that the target pixel points belong to residual pig hairs according to the product of the third eigenvalue and the consistency value, including: Take the product of the third eigenvalue and the consistency value as the target product, and take the result of normalizing the target product as the probability value that the target pixel points belong to residual pig hairs.

8. The intelligent detection method for pig hair removal according to claim 1, characterized in that, Cluster the pixel points in the grayscale image, including: Take the pixel values of the red channel, green channel, and blue channel in the visible light image of the outer surface of the pigskin of the target pixel points in the grayscale image as the first clustering dimension, the second clustering dimension, and the third clustering dimension of the target pixel points in sequence; Cluster the pixel points in the grayscale image by means of mean shift clustering according to the probability values, the first clustering dimension, the second clustering dimension, and the third clustering dimension of the pixel points in the grayscale image.

9. The intelligent detection method for pig hair removal according to claim 1, wherein, The clustering result includes multiple clustering clusters. Determine the detection result of the residual pig hairs on the outer surface of the pigskin according to the clustering result, including: Take the average value of the probability values of all pixel points in the clustering cluster as the evaluation value of the clustering cluster; take the clustering cluster with an evaluation value greater than the preset probability threshold as the target clustering cluster where the residual pig hairs are located. Take the area composed of the pixel points included in the target clustering cluster as the target defect area where the residual pig hair is located.

10. The intelligent detection method for pig hair removal according to claim 1, characterized in that The method further includes: When the detection result indicates that there is residual pig hair on the outer surface of the pigskin, control the pig hair processing device to perform hair removal on the outer surface of the pigskin again.

Citation Information

Patent Citations

  • Metal workpiece surface pocking mark defect detection method

    CN115131359A

  • Quality evaluation method for surface roughness of polishing pad

    CN116030058A

  • Plastic mold surface defect analysis and detection method based on image processing

    CN116934740A

  • Polycrystal layer photoetching process hot spot detection method based on image processing

    CN117173176A

  • Animal body temperature intelligent monitoring system for animal husbandry and veterinary medicine based on data enhancement

    CN117237244A