Intelligent grading method for procambarus clarkii based on image processing technology

By combining images of the back and side of the red swamp crayfish, analyzing the degree of tail curling and correcting the area of ​​the dorsal trunk region, the problem of inaccurate grading when the tail of the red swamp crayfish is curled is solved, and the accuracy of grading is improved.

CN121095665AInactive Publication Date: 2025-12-09YANCHENG INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511240983.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-02
Publication Date
2025-12-09
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing image processing-based grading methods for Procambarus clarkii (red swamp crayfish) struggle to accurately identify the body region when the crayfish's tail is curled, leading to inaccurate grading results.

Method used

By acquiring images of the back and sides of the red swamp crayfish, analyzing the degree of tail curling, and using the degree of tail curling to correct the area of ​​the back trunk region, the grade of the red swamp crayfish is determined by combining the relationship between the back and side trunk regions.

Benefits of technology

It improves the accuracy of grading red swamp crayfish, especially when the crayfish tail is curled, enabling more accurate assessment of its size and grade.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121095665A_ABST
    Figure CN121095665A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to an intelligent grading method for procambarus clarkii based on an image processing technology. The method comprises the following steps: acquiring a back trunk area and a side trunk area in a back image and a side image of procambarus clarkii; obtaining the contour edge of the back torso area and edge segments in the back torso area, and screening the edge segments to obtain suspected abdominal segment edge segments; the suspected abdominal segment edge section closest to the tail direction and the contour edge of the back trunk area form a suspected tail segment area, then whether the shrimp tail is curled or not is judged, and if yes, a first key point and a second key point are obtained; thirdly, acquiring a third key point and a fourth key point on the contour edge of the side trunk area; and analyzing the edge section between the third key point and the fourth key point to obtain the curling degree of the shrimp tail, further correcting the area of the back trunk area, and judging the grade of the procambarus clarkii according to the corrected area. According to the method, the grading accuracy of the procambarus clarkii can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and specifically to a smart grading method for red swamp crayfish based on image processing technology. Background Technology

[0002] The red swamp crayfish (Procambarus clarkii) is a highly valuable aquatic species, commonly used in the catering and export processing industries. In the market, crayfish prices are typically set at different unit prices based on their size. Furthermore, different sizes of crayfish require separate processing and packaging during the processing and packaging process. Therefore, grading the red swamp crayfish is a crucial step in the crayfish processing and production process.

[0003] Existing image processing-based grading methods for red swamp crayfish primarily involve capturing images of the crayfish's back, using image annotation and neural network convolution to identify the crayfish's body section, and then assessing its grade. However, because red swamp crayfish may not remain in an extended state during transport on conveyor belts, the traditional grading methods may not fully identify the crayfish's body region when the tail is curled, leading to potentially inaccurate grading results. Summary of the Invention

[0004] To address the aforementioned technical problems, the present invention aims to provide a smart grading method for Procambarus clarkii based on image processing technology. The specific technical solution adopted is as follows:

[0005] One embodiment of the present invention provides a smart grading method for red swamp crayfish based on image processing technology, the method comprising:

[0006] Obtain the body region of the crayfish from the dorsal and lateral images, and denote them as the dorsal body region and the lateral body region, respectively.

[0007] Obtain the outline edge of the back trunk region and the edge segments within the back trunk region; filter the edge segments based on the difference between the coordinate changes of the edge points of each edge segment and the coordinate changes of the edge points of other edge segments to obtain suspected abdominal edge segments;

[0008] The suspected telson region is formed by the edge segment of the suspected abdominal segment closest to the tail and the outline edge of the dorsal trunk region. The curvature value of the edge point on the outer edge of the suspected telson region is used to determine whether the shrimp tail is curled. If it is curled, the intersection of the edge segment of the suspected abdominal segment closest to the tail and the outline edge of the dorsal trunk region is recorded as the first key point and the second key point.

[0009] Based on the correspondence between the back trunk region and the side trunk region, find the corresponding point on the outline edge of the side trunk region and record it as the third key point; starting from the third key point, analyze each edge point on the outline edge of the side trunk region along the direction of the shrimp tail curl to obtain the fourth key point.

[0010] The degree of tail curl is obtained by analyzing the edge segment between the third and fourth key points on the outline edge of the lateral body region; the area of ​​the dorsal body region is corrected by using the degree of tail curl; and the grade of the red swamp crayfish is determined based on the corrected area of ​​the dorsal body region.

[0011] Preferably, the edge segments are screened to obtain suspected ventral segment edge segments based on the difference between the coordinate changes of the edge points of each edge segment and the coordinate changes of the edge points of other edge segments, including:

[0012] On an edge segment, a predetermined number of edge points are selected at equal intervals as representative points of the edge segment, and the distance between the representative points at both ends of the edge segment is the same as the distance between the representative points at both ends of the edge segment; the representative points of each edge segment are arranged in a uniform positional order to form a sequence of representative points corresponding to each edge segment.

[0013] Obtain the difference between the x-coordinates of the latter and former representative points in the representative point sequence corresponding to an edge segment, denoted as the x-coordinate change index. Form a sequence of x-coordinate change indices for every two adjacent representative points according to the order of the representative point sequence. Similarly, obtain the sequence of y-coordinate change indices corresponding to the representative point sequence. Add the absolute value of the difference between the first x-coordinate change index in the x-coordinate change index sequence corresponding to one edge segment and the absolute value of the difference between the first y-coordinate change index in the y-coordinate change index sequence corresponding to one edge segment and the hyperparameter, and invert the result to obtain the coordinate change similarity. Summate all the coordinate change similarities obtained from the x-coordinate change index sequences and y-coordinate change index sequences of one edge segment and the other edge segment to obtain the comprehensive coordinate change similarity between the two edge segments.

[0014] The probability of a ventral segment edge is obtained by summing the similarity of the comprehensive coordinate changes between the edge segment and other edge segments; the six edge segments with the highest probability of being ventral segment edges are selected as suspected ventral segment edge segments.

[0015] Preferably, determining whether the shrimp tail is curled based on the curvature value of the edge point on the outer edge of the suspected telson region includes:

[0016] The curvature difference between the curvature values ​​of the latter and the former of two adjacent edge points on the outer edge of the suspected telson region is recorded as the curvature difference between these two adjacent edge points. The curvature difference values ​​of every two adjacent edge points form a curvature difference value sequence. The average of the absolute values ​​of the differences between every two adjacent curvature difference values ​​in the curvature difference value sequence is calculated and normalized to obtain the probability of the true telson region of the suspected telson region. If the probability of the true telson is greater than a first preset threshold, the shrimp tail has not curled and the suspected telson region is the true telson. If the probability of the true telson is less than or equal to the first preset threshold, the shrimp tail has curled.

[0017] Preferably, based on the correspondence between the back torso region and the side torso region, a corresponding point is found on the outline edge of the side torso region, denoted as the third key point, including:

[0018] Find the edge points closest to the shrimp head in the back and side torso regions, respectively, and denot them as the first shrimp head pixel and the second shrimp head pixel. Obtain the vertical distance between the first shrimp head pixel in the back torso region and the line connecting the first key point and the second key point, and denot it as the first distance. Starting from the second shrimp head pixel in the side torso region, draw a line segment with a length of the first distance along the horizontal direction towards the shrimp tail. Draw a straight line perpendicular to the line segment along the other end of the line segment. The first intersection of the straight line with the contour edge of the side torso region is the third key point.

[0019] Preferably, starting from the third key point, the fourth key point is obtained by analyzing the edge points on the contour edge of the lateral torso region along the direction of the shrimp tail curl, including:

[0020] Starting from the third key point, along the direction of the shrimp tail curl, obtain the angle between each edge point on the contour edge of the side body region and the line connecting the adjacent edge points. If the angle corresponding to an edge point is less than the preset angle, then the edge point is considered to be the fourth key point.

[0021] Preferably, the degree of shrimp tail curling is obtained by analyzing the edge segment between the third and fourth key points on the contour edge of the lateral torso region, including:

[0022] The edge segment between the third and fourth key points on the contour edge of the side torso region is denoted as the edge segment to be analyzed. The polar coordinates of each edge point on the edge segment to be analyzed are obtained. The difference between the angle in the polar coordinates of the latter edge point and the angle in the polar coordinates of the former edge point is mapped using the cosine function to obtain the cosine function mapping value corresponding to the two adjacent edge points. The negative value of the mean of the cosine function mapping value corresponding to each pair of adjacent edge points on the edge segment to be analyzed is calculated and normalized to obtain the degree of shrimp tail curling.

[0023] Preferably, the area of ​​the back-body region is corrected by utilizing the degree of curling of the shrimp tail, including:

[0024] The degree of curling influence is obtained by comparing the number of pixels on the edge segment to be analyzed between the third and fourth key points with the first distance; the area of ​​the back body region is corrected according to the degree of curling of the shrimp tail and the degree of curling influence.

[0025] Preferably, the area of ​​the dorsal trunk region is corrected according to the degree of curling of the shrimp tail and the degree of influence of the curling, including:

[0026] The first preset value plus the product of the degree of shrimp tail curling and the degree of curling influence is the correction coefficient; the area of ​​the back trunk region is multiplied by the correction coefficient to obtain the corrected area of ​​the back trunk region.

[0027] Preferably, the grade of the red swamp crayfish is determined based on the area of ​​the corrected dorsal trunk region, including:

[0028] The area of ​​the corrected dorsal trunk region is compared with the area of ​​the dorsal image to obtain the dorsal trunk ratio; the grade of the red swamp crayfish is determined based on the dorsal trunk ratio.

[0029] The embodiments of the present invention have at least the following beneficial effects: By comprehensively analyzing the body region of the crayfish in the dorsal and lateral images of the crayfish, this application can more accurately determine the size of the crayfish, effectively solving the problem that a single-angle image cannot accurately assess the size of the crayfish when it is in a curled-up state, and improving the accuracy of the grading of the crayfish.

[0030] Simultaneously, the intersection point of the suspected abdominal segment edge closest to the tail and the outline edge of the dorsal trunk region is first obtained and recorded as the first and second key points. Then, based on the correspondence between the shrimp trunk regions in the dorsal and lateral images, the third and fourth key points on the outline edge of the lateral trunk region are obtained. Furthermore, the edge segment between the third and fourth key points on the outline edge of the lateral trunk region is analyzed to obtain the degree of tail curling. Finally, the area of ​​the dorsal trunk region is corrected using the degree of tail curling, which can improve the correction result for the area of ​​the dorsal trunk region with a curled tail, obtain an accurate dorsal trunk region, and improve the accuracy of grading Procambarus clarkii. Attached Figure Description

[0031] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1 A flowchart illustrating a smart grading method for red swamp crayfish based on image processing technology, provided in an embodiment of the present invention;

[0033] Figure 2 A simplified schematic diagram illustrating the key point determination of a smart grading method for red swamp crayfish based on image processing technology, provided in an embodiment of the present invention. Detailed Implementation

[0034] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a smart grading method for red swamp crayfish based on image processing technology proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0035] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0036] The following description, in conjunction with the accompanying drawings, details a specific scheme for a smart grading method for red swamp crayfish based on image processing technology provided by the present invention.

[0037] Example:

[0038] The main application scenario of this invention is to combine images of Procambarus clarkii taken from different angles to improve the accuracy of size identification of Procambarus clarkii and improve the reliability of grading results.

[0039] Please see Figure 1 The diagram illustrates a flowchart of a smart grading method for red swamp crayfish based on image processing technology, provided by an embodiment of the present invention. The method includes the following steps:

[0040] Step S1: Obtain the body region of the crayfish from the dorsal and lateral images, and denote them as the dorsal body region and the lateral body region, respectively.

[0041] To obtain clearer images of the red swamp crayfish's back and side, a narrow guide trough was installed at the front of the conveyor belt, ensuring that the crayfish were all arranged head-forward as they entered the conveyor belt. The conveyor belt was white to facilitate the segmentation of the crayfish areas. Cameras were installed directly above and to the side of the conveyor belt to capture images of the crayfish's back and side as they passed designated locations.

[0042] Furthermore, the white background in the back and side images is removed to obtain back and side images containing only the red swamp crayfish region, and image closing operations are used to smooth out some small reflective spots in the red swamp crayfish region.

[0043] Furthermore, a convolutional neural network was trained using a dataset of annotated images of the red swamp crayfish (Procambarus clarkii) torso to obtain a red swamp crayfish torso recognition model. Back and side images containing only the red swamp crayfish region were input into the model to obtain the crayfish's torso region from the back and side images, respectively denoted as the back torso region and the side torso region. The recognition of the back and side torso regions is a well-known technique and will not be elaborated upon here.

[0044] Step S2: Obtain the outline edge of the back trunk region and the edge segments within the back trunk region; based on the difference between the coordinate changes of the edge points of each edge segment and the coordinate changes of the edge points of other edge segments, filter the edge segments to obtain suspected abdominal edge segments.

[0045] Since the shape of the tail in the dorsal image of the red swamp crayfish differs greatly between its curled and uncurled states, the first step is to determine whether the crayfish is curled based on the shape characteristics of its tail in the dorsal image.

[0046] First, in the image captured by the camera directly above the conveyor belt (the back image of the red swamp crayfish), edge detection algorithms are used to extract the edge points of the outer edge contour of the crayfish's back trunk region, thus obtaining the contour edge of the back trunk region in the back image. Next, an edge detection algorithm (Sobel edge detection) is used to obtain the edge points inside the back trunk region, that is, to obtain the internal texture edges; edge points refer to edge points. Since the crayfish maintains a forward-facing orientation when entering the conveyor belt, the head and tail directions of the crayfish are obtained based on the image capture direction. Because the red swamp crayfish's body is composed of multiple segments (including abdominal segments and telson), and the edges of each abdominal segment are relatively parallel, while the telson does not have this structure, based on the body structural characteristics of the red swamp crayfish, the suspected telson region to be analyzed can be segmented.

[0047] Furthermore, a coordinate system is constructed, with the direction the shrimp's head faces as the horizontal axis and the vertical direction as the vertical axis, thus obtaining the coordinates of all edge points. Further, adjacent edge points within the back-body region are divided into the same edge segment. This segmentation does not include edge segments on the contour edges of the back-body region. Also, because some raised textures on the shrimp's head may identify some edge segments, these are not the desired edge segments. To reduce computational complexity, edge segments with more than a preset number of edge points are retained. The reference value for the preset number is 10, which can be adjusted. Only edge segments with more than the preset number of edge points are retained for subsequent analysis.

[0048] Next, the edge segments are filtered to obtain suspected ventral segment edge segments based on the differences in coordinate changes of edge points from other edge segments. However, since the number of edge points in each edge segment is different, representative points need to be extracted from each edge segment to facilitate the determination of their shape similarity. Specifically, a preset number (preset number is 10) of edge points are selected evenly at the same interval on an edge segment as representative points of that edge segment, and the distance between the representative points at both ends of the edge segment is the same as that between the edge points at both ends of the edge segment. This yields representative points for each edge segment. The representative points of each edge segment are then arranged in a uniform positional order to form a representative point sequence for each edge segment. For example, if the representative points of one edge segment are arranged in a top-down order to form the representative point sequence for that edge segment, then the other edge segments are also arranged in the same order to form representative point sequences.

[0049] The difference between the x-coordinates of the latter and former representative points in the representative point sequence corresponding to an edge segment is obtained and denoted as the x-coordinate change index. The x-coordinate change indices corresponding to every two adjacent representative points are arranged into a sequence of x-coordinate change indices according to the order of the representative point sequence. Similarly, the sequence of y-coordinate change indices corresponding to the representative point sequence is obtained. The absolute value of the difference between the first x-coordinate change index in the sequence of x-coordinate change indices corresponding to the edge segment and the first y-coordinate change index in the sequence of y-coordinate change indices corresponding to the edge segment and the other edge segment, and the hyperparameter are added together and inverted to obtain the coordinate change similarity. All coordinate change similarities obtained from the x-coordinate change index sequences and y-coordinate change index sequences of the edge segment and the other edge segment are summed to obtain the comprehensive coordinate change similarity between the edge segment and the other edge segment. The comprehensive coordinate change similarity between the edge segment and all other edge segments is summed to obtain the ventral edge probability of the edge segment. Then, the ventral edge probability of all edge segments is obtained. The ventral edge probability is used to filter all edge segments to obtain the ventral edge segments.

[0050] Since the red swamp crayfish has a total of 6 abdominal segments, there are at most 6 abdominal segment edge segments in the dorsal trunk region of the dorsal image. Therefore, the 6 edge segments with the highest probability of being abdominal segment edges are selected as suspected abdominal segment edge segments.

[0051] The specific calculation model for the probability of ventral segment margins is as follows:

[0052] ;

[0053] in, This represents the probability that the first edge segment is the abdominal segment edge, that is, the probability that the edge segment is the abdominal segment edge of a crayfish. ε is a hyperparameter used to prevent the denominator from being 0, and its value is 0.01. This is the difference in the x-coordinate between the (i+1)th and ith representative points in the sequence of representative points corresponding to the first edge segment; it is also the index of the change in the x-coordinates of these two representative points. It represents the difference in the x-coordinate between the (i+1)th and the ith representative point in the representative point sequence corresponding to the t-th edge segment, excluding the 1st edge segment. It is also the x-coordinate change index corresponding to these two representative points. The difference in the ordinate between the (i+1)th and ith representative points in the representative point sequence corresponding to the first edge segment is also the index of change in the ordinate of these two representative points. This represents the difference in the ordinate between the (i+1)th and the ith representative point in the sequence of representative points corresponding to the t-th edge segment, excluding the first edge segment. It is also the index of the change in the ordinate of these two representative points. This represents the total number of remaining edge segments excluding the first edge segment. This represents the number of representative points in the representative point sequence, with a value of 10.

[0054] The similarity of coordinate changes is represented by the elements at the same position in the sequence of horizontal and vertical coordinate changes corresponding to the first and t-th edge segments. This indicates the similarity of the overall coordinate changes between the 1st edge segment and the tth edge segment. The closer the changes in the horizontal and vertical coordinates of the 1st edge segment and the tth edge segment are, the more similar the two edge segments are. In other words, the 1st edge segment is more likely to be the abdominal segment edge of the crayfish.

[0055] Step S3: The suspected telson region is formed by the edge segment of the suspected abdominal segment closest to the tail and the outline edge of the dorsal trunk region. The shrimp tail is judged to be curled based on the curvature value of the edge point on the outer edge of the suspected telson region. If it is curled, the intersection of the edge segment of the suspected abdominal segment closest to the tail and the outline edge of the dorsal trunk region is recorded as the first key point and the second key point.

[0056] The above analysis based on the back image obtained 6 suspected abdominal segment edge segments in the back trunk region. According to the body characteristics of the red swamp crayfish, the suspected abdominal segment edge segment closest to the tail can be combined with the outline edge of the back trunk region to form a suspected telson region. Then, the suspected telson region is analyzed to determine whether the crayfish tail is curled.

[0057] The edge of the crayfish's telson usually has some serrated bristles. However, when the crayfish's tail is curled, the area suspected to be the telson is actually the abdominal segment, and its edge becomes smoother. Therefore, obtaining the curvature value at each edge point on the outer edge of the suspected telson area, that is, the curvature value corresponding to each edge point, indicates that the outer edge is smoother. Thus, based on the degree of change in curvature values ​​between adjacent edge points, it can be determined whether the suspected telson area is the actual telson or whether the tail has curled.

[0058] Specifically, the curvature difference between the curvature values ​​of the latter and former edge points on the outer edge of the suspected telson region is obtained and denoted as the curvature difference between these two adjacent edge points. Each pair of adjacent edge points forms a curvature difference sequence. The average of the absolute values ​​of the differences between each pair of adjacent curvature differences in the curvature difference sequence is calculated and normalized to obtain the probability of the true telson region. The curvature differences in the curvature difference sequence are arranged in the order of their proximity to the edge points on the outer edge.

[0059] The specific calculation model for the true probabilities of the tail segment is as follows:

[0060] ;

[0061] Where P represents the true proximal segment probability. , and Let represent the curvature values ​​of the i-th edge point on the outer edge of the suspected telson region, respectively. , These represent the curvature difference between two adjacent edge points. This represents the absolute value of the difference between two adjacent curvature differences in the curvature difference sequence. The mean value represents the average curvature variation of the upper edge points on the outer edge of the suspected telson region. The greater the difference in curvature variation, the more likely it is to be a true telson, indicating that the shrimp tail has not curled. The normalization operation is indicated by the normalization function.

[0062] Because the edge smoothness of the true, non-curled telson and abdominal segments differs significantly, the curvature values ​​of their edge points also vary considerably. After the above normalization process, the probability P values ​​of the true telson corresponding to the non-curled telson and the non-curled telson are distributed at both ends of the [0,1] interval. Therefore, the median value of 0.5 is taken as the first preset threshold. When the probability of the true telson is greater than the first preset threshold, it is considered that the shrimp tail has not curled, and the suspected telson region is the true telson. When the probability of the true telson is less than or equal to the first preset threshold, it indicates that the current shrimp tail has curled, meaning that the obtained dorsal trunk region cannot fully represent the true size of the current crayfish.

[0063] If the shrimp tail is curled, it is necessary to analyze the shrimp's body region in the side image to determine the degree of curvature. Therefore, the intersection of the suspected abdominal segment edge closest to the tail and the outline edge of the dorsal body region is recorded as the first key point and the second key point. The first key point and the second key point are the corresponding key points of the shrimp tail in the crayfish's dorsal image. Subsequent analysis is carried out based on these two key points and the body region in the side image.

[0064] Step S4: Based on the correspondence between the back torso region and the side torso region, find the corresponding point on the outline edge of the side torso region and record it as the third key point; starting from the third key point, analyze each edge point on the outline edge of the side torso region along the direction of the shrimp tail curl to obtain the fourth key point.

[0065] The first and second key points of the back image were obtained above. Since the shooting position and angle are fixed when shooting the back and side images, the positional correspondence between the back and side images is obtained based on the relationship between the two shooting angles, and the corresponding points are found on the contour edge of the side torso region.

[0066] Specifically, find the edge points closest to the shrimp head in both the back and side torso regions, denoted as the first and second shrimp head pixels. Obtain the vertical distance between the first shrimp head pixel in the back torso region and the line connecting the first and second key points, denoted as the first distance. Starting from the second shrimp head pixel in the side torso region, draw a line segment with a length of the first distance along a horizontal direction towards the shrimp tail. Draw a straight line perpendicular to the line segment along its other endpoint. The first intersection of this straight line with the contour edge of the side torso region is the third key point. Figure 2 As shown in the figure, A represents the first shrimp head pixel, B and C represent the first and second key points, L represents the first distance, A' represents the second shrimp head pixel, and D represents the third key point.

[0067] Since the end of the entire lateral body region when the shrimp tail curls is not the actual end of the tail, it is necessary to find the endpoint of the tail, which is the fourth key point. Because the telson of the shrimp tail is relatively flat, the endpoint appears pointed in the lateral image. Starting from the third key point and moving towards the direction of tail curling, we analyze each edge point on the contour edge of the lateral body region to see if it exhibits the endpoint feature. The first edge point with this feature is considered the other key point corresponding to the shrimp tail in the lateral image, which is the fourth key point.

[0068] Specifically, starting from the third keypoint, the angles between the lines connecting each edge point on the contour edge of the side body region and its adjacent edge points are sequentially obtained along the direction of the shrimp tail's curl. If the angle corresponding to an edge point is less than a preset angle, then that edge point is considered the fourth keypoint. The fourth keypoint is as follows: Figure 2 As shown at point E in the diagram, the direction in which the shrimp tail curls is the same as the direction of the curved arrow in the diagram.

[0069] The preset angle is 90° because, under the maximum flexibility of the red swamp crayfish, the included angle corresponding to its edge point is usually not less than 90°. When the included angle corresponding to an edge point is less than 90°, the edge point has the characteristics of the end point of the crayfish tail, so it is regarded as the fourth key point.

[0070] Step S5: Analyze the edge segment between the third and fourth key points on the outline edge of the lateral body region to obtain the degree of tail curling; use the degree of tail curling to correct the area of ​​the back body region; determine the grade of the red swamp crayfish based on the corrected area of ​​the back body region.

[0071] The third and fourth keypoints on the contour edge of the side body region of the side image were obtained. The degree of tail curling was obtained by analyzing the edge segment between the third and fourth keypoints on the contour edge. The edge segment between the third and fourth keypoints on the contour edge of the side body region was recorded as the edge segment to be analyzed. Since the number of pixels contained in the edge segment to be analyzed may vary for the curled part of the tail of different crayfish, which is related to the length of the crayfish and the position where the curling begins, in order to avoid the influence of different lengths of the edge segment to be analyzed on the obtained degree of curling, the degree of curling is calculated by using the average angle change of the edge points on the edge segment to be analyzed. The greater the angle change in the polar coordinates corresponding to adjacent edge points, the greater the degree of curling of the edge segment.

[0072] Specifically, the polar coordinates of each edge point on the edge segment to be analyzed are obtained. The difference between the angle in the polar coordinates of the latter edge point and the angle in the polar coordinates of the former edge point is mapped using the cosine function to obtain the cosine function mapping value corresponding to the two adjacent edge points. The negative value of the mean of the cosine function mapping value corresponding to every two adjacent edge points on the edge segment to be analyzed is calculated and normalized to obtain the degree of shrimp tail curling.

[0073] The specific model for calculating the degree of curl in shrimp tails is as follows:

[0074] ;

[0075] Where H represents the degree of shrimp tail curling, and norm represents the normalization operation. This represents the angle in polar coordinates of the (i+1)th edge point on the edge segment to be analyzed. This represents the angle in polar coordinates of the i-th edge point on the edge segment to be analyzed. This represents the cosine function mapping value corresponding to two adjacent edge points (the (i+1)th edge point and the ith edge point) on the edge segment to be analyzed. This indicates the number of edge points on the edge segment to be analyzed. The larger the cosine value, the smaller the corresponding angle difference, meaning the less curled the tail. This allows us to determine the current degree of tail curling in the red swamp crayfish.

[0076] Different crayfish may exhibit different tail curling patterns. Some crayfish only curl their tail segments, while others may curl from the abdominal segments. The degree to which this curling affects the accuracy of the current back-body region recognition varies. Specifically, the larger the proportion of the curled portion in the entire back-body region, the greater the difference between the recognized back-body region size and the true size. Therefore, the vertical distance (the number of pixels contained in this vertical line segment) between the crayfish head pixel (the pixel closest to the head in the back-body region) and the first and second key points is obtained (this is the first distance). The number of pixels contained in the edge segment to be analyzed between the third and fourth key points in the side-view image's body region is also calculated. Based on the proportional relationship of the number of pixels on these two lines, the degree to which the current crayfish tail curling affects the recognition of the crayfish's back-body region is calculated.

[0077] Specifically, the degree of curling effect is obtained by comparing the number of pixels on the edge segment to be analyzed between the third and fourth key points with the first distance. The first distance refers to the number of pixels contained in the vertical line segment connecting the first shrimp head pixel to the first and second key points.

[0078] Next, based on the degree of shrimp tail curling, and considering the impact of the shrimp tail curling on the recognition of the back torso (degree of curling influence), the area of ​​the back torso region is corrected. The greater the degree of curling influence, the greater the correction. Specifically, the first preset value plus the product of the shrimp tail curling degree and the degree of curling influence is the correction coefficient. The area of ​​the back torso region is multiplied by the correction coefficient to obtain the corrected area of ​​the back torso region.

[0079] The specific calculation model is as follows:

[0080] ;

[0081] in, M represents the area of ​​the back trunk region after correction, which is also the uncorrected area; the first preset value is 1, and H and k represent the degree of shrimp tail curling and the degree of influence of curling, respectively.

[0082] This yields the area of ​​the corrected dorsal trunk region. When the image angle and position are fixed, the true size of the red swamp crayfish can be reflected by the proportion of its dorsal trunk region within the entire back image. Therefore, the proportion of the corrected dorsal trunk region in the back image is calculated, and the dorsal trunk proportion is obtained by comparing the corrected dorsal trunk region area with the area of ​​the back image. In this embodiment, the area refers to the number of pixels in a region.

[0083] After obtaining the proportion of the red swamp crayfish's body in the back image (back body proportion), the current red swamp crayfish is graded using an existing model relating back body proportion to red swamp crayfish size and grade. It should be noted that if the tail does not curl during the above detection process, and the suspected telson region is indeed the telson, then there is no need to correct the area of ​​the back body region; the corresponding back body proportion can be directly obtained using the area of ​​the back body region to determine the grade of the red swamp crayfish.

[0084] In summary, this application utilizes multi-angle cameras positioned near the conveyor belt to capture images of the red swamp crayfish from different angles. Based on the dorsal image of the crayfish's body, and considering features from the lateral image, the degree of tail curling is analyzed. By comprehensively identifying the body size and tail curling degree, the red swamp crayfish are graded, effectively addressing the impact of tail curling on the accuracy of the identification results.

[0085] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this specification. Additionally, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0086] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

[0087] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A smart grading method for Procambarus clarkii based on image processing technology, characterized in that, The method includes: Obtain the body region of the crayfish from the dorsal and lateral images, and denote them as the dorsal body region and the lateral body region, respectively. Obtain the outline edge of the back trunk region and the edge segments within the back trunk region; filter the edge segments based on the difference between the coordinate changes of the edge points of each edge segment and the coordinate changes of the edge points of other edge segments to obtain suspected abdominal edge segments; The suspected telson region is formed by the edge segment of the suspected abdominal segment closest to the tail and the outline edge of the dorsal trunk region. The curvature value of the edge point on the outer edge of the suspected telson region is used to determine whether the shrimp tail is curled. If it is curled, the intersection of the edge segment of the suspected abdominal segment closest to the tail and the outline edge of the dorsal trunk region is recorded as the first key point and the second key point. Based on the correspondence between the back trunk region and the side trunk region, find the corresponding point on the outline edge of the side trunk region and record it as the third key point; starting from the third key point, analyze each edge point on the outline edge of the side trunk region along the direction of the shrimp tail curl to obtain the fourth key point. The degree of tail curl is obtained by analyzing the edge segment between the third and fourth key points on the outline edge of the lateral body region; the area of ​​the dorsal body region is corrected by using the degree of tail curl; and the grade of the red swamp crayfish is determined based on the corrected area of ​​the dorsal body region.

2. The intelligent grading method for Procambarus clarkii based on image processing technology according to claim 1, characterized in that, The process of filtering edge segments to obtain suspected ventral segment edge segments based on the difference between the coordinate changes of the edge points of each edge segment and the coordinate changes of the edge points of other edge segments includes: On an edge segment, a predetermined number of edge points are selected at equal intervals as representative points of the edge segment, and the distance between the representative points at both ends of the edge segment is the same as the distance between the representative points at both ends of the edge segment; the representative points of each edge segment are arranged in a uniform positional order to form a sequence of representative points corresponding to each edge segment. Obtain the difference between the x-coordinates of the latter and former representative points in the representative point sequence corresponding to an edge segment, denoted as the x-coordinate change index. Form a sequence of x-coordinate change indices for every two adjacent representative points according to the order of the representative point sequence. Similarly, obtain the sequence of y-coordinate change indices corresponding to the representative point sequence. Add the absolute value of the difference between the first x-coordinate change index in the x-coordinate change index sequence corresponding to one edge segment and the absolute value of the difference between the first y-coordinate change index in the y-coordinate change index sequence corresponding to one edge segment and the hyperparameter, and invert the result to obtain the coordinate change similarity. Summate all the coordinate change similarities obtained from the x-coordinate change index sequences and y-coordinate change index sequences of one edge segment and the other edge segment to obtain the comprehensive coordinate change similarity between the two edge segments. The probability of a ventral segment edge is obtained by summing the similarity of the comprehensive coordinate changes between the edge segment and other edge segments; the six edge segments with the highest probability of being ventral segment edges are selected as suspected ventral segment edge segments.

3. The intelligent grading method for Procambarus clarkii based on image processing technology according to claim 1, characterized in that, The step of determining whether the shrimp tail is curled based on the curvature value of the edge points on the outer edge of the suspected telson region includes: The curvature difference between the curvature values ​​of the latter and the former of two adjacent edge points on the outer edge of the suspected telson region is recorded as the curvature difference between these two adjacent edge points. The curvature difference values ​​of every two adjacent edge points form a curvature difference value sequence. The average of the absolute values ​​of the differences between every two adjacent curvature difference values ​​in the curvature difference value sequence is calculated and normalized to obtain the probability of the true telson region of the suspected telson region. If the probability of the true telson is greater than a first preset threshold, the shrimp tail has not curled and the suspected telson region is the true telson. If the probability of the true telson is less than or equal to the first preset threshold, the shrimp tail has curled.

4. The intelligent grading method for Procambarus clarkii based on image processing technology according to claim 1, characterized in that, The process of finding corresponding points on the contour edge of the side torso region based on the correspondence between the back torso region and the side torso region, denoted as the third key point, includes: Find the edge points closest to the shrimp head in the back and side torso regions, respectively, and denot them as the first shrimp head pixel and the second shrimp head pixel. Obtain the vertical distance between the first shrimp head pixel in the back torso region and the line connecting the first key point and the second key point, and denot it as the first distance. Starting from the second shrimp head pixel in the side torso region, draw a line segment with a length of the first distance along the horizontal direction towards the shrimp tail. Draw a straight line perpendicular to the line segment along the other end of the line segment. The first intersection of the straight line with the contour edge of the side torso region is the third key point.

5. The intelligent grading method for Procambarus clarkii based on image processing technology according to claim 1, characterized in that, The fourth key point is obtained by analyzing the edge points on the contour edge of the lateral torso region along the direction of the shrimp tail curl, starting from the third key point. This includes: Starting from the third key point, along the direction of the shrimp tail curl, obtain the angle between each edge point on the contour edge of the side body region and the line connecting the adjacent edge points. If the angle corresponding to an edge point is less than the preset angle, then the edge point is considered to be the fourth key point.

6. The intelligent grading method for Procambarus clarkii based on image processing technology according to claim 1, characterized in that, The analysis of the edge segment between the third and fourth key points on the contour edge of the lateral torso region to obtain the degree of shrimp tail curling includes: The edge segment between the third and fourth key points on the contour edge of the side torso region is denoted as the edge segment to be analyzed. The polar coordinates of each edge point on the edge segment to be analyzed are obtained. The difference between the angle in the polar coordinates of the latter edge point and the angle in the polar coordinates of the former edge point is mapped using the cosine function to obtain the cosine function mapping value corresponding to the two adjacent edge points. The negative value of the mean of the cosine function mapping value corresponding to each pair of adjacent edge points on the edge segment to be analyzed is calculated and normalized to obtain the degree of shrimp tail curling.

7. The intelligent grading method for Procambarus clarkii based on image processing technology according to claim 1, characterized in that, The method of correcting the area of ​​the back and torso region by utilizing the degree of curling of the shrimp tail includes: The degree of curling influence is obtained by comparing the number of pixels on the edge segment to be analyzed between the third and fourth key points with the first distance; the area of ​​the back body region is corrected according to the degree of curling of the shrimp tail and the degree of curling influence.

8. The intelligent grading method for Procambarus clarkii based on image processing technology according to claim 7, characterized in that, The method of correcting the area of ​​the back trunk region based on the degree of shrimp tail curling and the extent of its influence includes: The first preset value plus the product of the degree of shrimp tail curling and the degree of curling influence is the correction coefficient; the area of ​​the back trunk region is multiplied by the correction coefficient to obtain the corrected area of ​​the back trunk region.

9. The intelligent grading method for Procambarus clarkii based on image processing technology according to claim 1, characterized in that, The method of determining the grade of the red swamp crayfish based on the area of ​​the corrected dorsal trunk region includes: The area of ​​the corrected dorsal trunk region is compared with the area of ​​the dorsal image to obtain the dorsal trunk ratio; the grade of the red swamp crayfish is determined based on the dorsal trunk ratio.