A method and trimming device for recognizing the anal fin contour of rainbow trout fillets
By establishing a fish fillet coordinate system through 3D point cloud data processing and principal component analysis, and using curvature and height thresholds to identify the anal fin region of rainbow trout fillets, and combining region growing algorithms and polynomial fitting to generate cutting paths, the problem of manual dependence and poor 2D image segmentation effect in the trimming of anal fins of rainbow trout fillets is solved, and efficient and accurate automated trimming is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FISHERY MACHINERY & INSTR RES INST CHINESE ACADEMY OF FISHERY SCI
- Filing Date
- 2026-02-05
- Publication Date
- 2026-05-26
Smart Images

Figure CN122089770A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of aquaculture equipment, specifically to a method for recognizing the anal fin contour of rainbow trout fillets and a trimming device. Background Technology
[0002] In rainbow trout processing, the rainbow trout fillets obtained after slicing still need to be finely trimmed of the remaining anal fin. Currently, this process is highly dependent on skilled workers, which is not only inefficient and costly, but also results in unstable trimming quality and meat yield due to individual differences in the fish, which seriously restricts product standardization.
[0003] Traditional automated solutions employ two-dimensional image sensors to acquire images of fish fillets and utilize image processing algorithms such as edge detection, thresholding, or deep learning semantic segmentation to identify the anal fin location. However, two-dimensional methods primarily rely on RGB color or grayscale differences. The anal fin area of rainbow trout fillets is very similar in color and texture to the surrounding fish meat, especially when there are water stains, blood stains, or uneven lighting (such as reflections or shadows) on the fillet surface. Two-dimensional images struggle to capture effective distinguishing features. Therefore, traditional automated solutions are difficult to directly apply to the identification and trimming of anal fins in rainbow trout fillets. Summary of the Invention
[0004] In view of the technical problems in the existing rainbow trout fillet trimming process, such as low efficiency and inconsistent standards of manual identification, susceptibility of traditional 2D image segmentation methods to interference from color and texture, and inability to cope with the flexible deformation of the fish body, this invention aims to provide a method and trimming equipment for identifying the anal fin contour of rainbow trout fillets.
[0005] The objective of this invention can be achieved through the following technical solutions:
[0006] A method for recognizing the anal fin contour of a rainbow trout fillet, comprising:
[0007] S1: Acquire point cloud data of the fish fillet and transform the point cloud data from the camera coordinate system to the trimming device coordinate system;
[0008] S2: Preprocess the converted point cloud data to obtain the fish slice point cloud, calculate the principal axis direction of the fish slice point cloud using principal component analysis, and establish a fish slice coordinate system that follows the posture of the fish slice.
[0009] S3: Extract the anal fin contour in the fish fillet coordinate system, which includes: calculating the normal vector and curvature of each point in the fish fillet point cloud; selecting a set of point clouds belonging to the anal fin region from the fish fillet point cloud according to preset curvature threshold, height threshold and width threshold; selecting seed points in the point cloud set, performing region growth based on the consistency of spatial distance and normal vector of the point cloud, obtaining the anal fin region point set, and extracting the boundary point set from it as the anal fin contour.
[0010] A further improvement of the present invention is that, in step S1, statistical filtering is used to remove outliers to obtain the fish slice point cloud.
[0011] A further improvement of the present invention is that the process of establishing the fish fillet coordinate system in step S2 specifically includes:
[0012] S21: Calculate the centroid of the fish fillet point cloud in the coordinate system of the trimming equipment;
[0013] S22: Calculate the covariance matrix of the fish fillet point cloud and perform eigenvalue decomposition on the covariance matrix to obtain three eigenvalues and their corresponding eigenvectors.
[0014] S23: Establish the fish fillet coordinate system with the centroid as the origin, the eigenvector corresponding to the largest eigenvalue as the X-axis, the eigenvector corresponding to the second largest eigenvalue as the Y-axis, and the eigenvector corresponding to the smallest eigenvalue as the Z-axis, and take the X-axis as the principal axis direction;
[0015] S24: Record the position of the origin of the fish fillet coordinate system in the trimming device coordinate system at the moment of image acquisition.
[0016] A further improvement of the present invention is that, in step S3, the method for calculating the normal vector and curvature of any point in the fish fillet point cloud is as follows:
[0017] Search for the set of k nearest neighbors of the given point;
[0018] Calculate the Find the covariance matrix of the nearest neighbor set of points, and calculate the eigenvalues of this covariance matrix. , , ,in: ;
[0019] Take the smallest eigenvalue The corresponding eigenvector is used as the normal vector of that point. And calculate the curvature at that point:
[0020] ;
[0021] in: For curvature.
[0022] A further improvement of the present invention is that, in step S3, the criteria for selecting the point cloud set belonging to the anal fin region from the fish fillet point cloud include:
[0023]
[0024] in: The point cloud set for the anal fin region; For the first One point; For the first Curvature at each point; The threshold value for anal fin curvature; Let Z be the Z coordinate of the i-th point; The height threshold; Let be the y-coordinate of the i-th point; This is the width threshold.
[0025] A further improvement of the present invention is that, in step S3, the region growth process includes: selecting a seed point in the point cloud set of the anal fin region, filtering the points to be grown based on the seed point or the current growth point and the growth conditions, and finally obtaining the point set of the anal fin region and using a point cloud boundary extraction algorithm to obtain the anal fin contour from the point set of the anal fin region; the growth conditions include: the Euclidean distance between the point to be grown and the seed point or the current growth point is less than the maximum distance. And the normal vector of the growth point. Normal vector of seed point or current growth point The dot product is greater than the preset angle cosine threshold. .
[0026] A further improvement of this invention is that it also includes performing least-squares fitting on the extracted anal fin contour to obtain a contour curve. During the least-squares fitting process, a polynomial curve fitting is used.
[0027] ;
[0028] in: For parameters The corresponding point on the polynomial curve of the anal fin; For polynomial coefficients (three-dimensional vector); These are curve parameters, with values ranging from 0 to 1; For the squares and cubes of the parameters; For coefficient vectors;
[0029] The coefficients are solved using the least squares method, and the expression is as follows:
[0030] ;
[0031] in: To minimize the set of polynomial coefficients The objective function;
[0032] The square of the distance between the j-th boundary point and its corresponding point on the polynomial curve; This represents the number of boundary points of the anal fin.
[0033] A further improvement of the present invention is that it also includes generating a cutting path based on the contour curve, wherein during the process of generating the cutting path, a predetermined distance is offset outward from the anal fin region along the fitted contour curve as a margin, and the offset contour curve is used as the cutting path.
[0034] The present invention also provides a trimming device, which uses the above-described method to obtain the anal fin outline and cutting path of a rainbow trout fillet, and cuts the anal fin of the rainbow trout fillet along the cutting path.
[0035] A further improvement of the present invention is that it includes a multispectral camera; the trimming device acquires point cloud data of rainbow trout slices through the multispectral camera.
[0036] Compared with the prior art, the present invention has the following significant advantages:
[0037] The identification method of this invention does not rely on the color and texture information of 2D images, but uses the spatial geometric features (curvature and height) provided by a color 3D point cloud for identification. Since there are essential differences between the anal fin and the fish flesh in terms of height and surface roughness (curvature), this method can effectively overcome the influence of water stains, blood stains, and uneven lighting on the identification results of the fish fillet surface, and greatly improve the identification accuracy in complex processing environments.
[0038] This invention employs a dynamic coordinate system establishment mechanism based on Principal Component Analysis (PCA). Regardless of the angle at which the fish fillets are positioned on the conveyor belt, or even slight wrinkles caused by the flexible nature of the fillets, the system can automatically establish a dynamic coordinate system for the fish fillets, ensuring that the recognition algorithm always operates under a unified benchmark. This fundamentally solves the problem of a significant drop in recognition rate when 2D vision methods encounter changes in the pose of fish fillets. Attached Figure Description
[0039] Figure 1 This is a flowchart of a method for recognizing the anal fin contour of a rainbow trout fillet.
[0040] Figure 2 Photos of rainbow trout fillets before and after trimming. Detailed Implementation
[0041] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0042] like Figure 1 , Figure 2As shown, an embodiment of the present invention provides a method for recognizing the anal fin contour of rainbow trout fillets. This method is used to provide an accurate cutting path for an automated trimming device for rainbow trout fillets. In the trimming device, the rainbow trout fillets move forward at a constant speed V on the conveyor belt. The system completes image acquisition of the rainbow trout fillet at point A (image acquisition point A) of the trimming device, establishes a three-dimensional point cloud of the rainbow trout fillet, and identifies the contour features of the dorsal fin, caudal fin, and anal fin. The system then generates the cutting path required for trimming in the fillet coordinate system so that the subsequent trimming station B can cut the fillet according to the cutting path.
[0043] In this embodiment, a multispectral camera installed at image acquisition point A acquires color 3D point cloud data of rainbow trout fillets. Coordinate transformation technology is used to convert the point cloud from the camera coordinate system to the trimming device coordinate system. Principal component analysis (PCA) is then used to dynamically establish a fish fillet coordinate system aligned with the fillet's posture. In the fish fillet coordinate system, the system first preprocesses the point cloud and estimates its normal vectors. Then, it intelligently identifies the anal fin region by combining multiple feature thresholds for curvature, height, and width. Subsequently, a region growing algorithm is used to extract the anal fin region point set, and a boundary extraction algorithm is used to extract the continuous boundary of the anal fin. For the extracted anal fin contour, a polynomial curve is used for fitting, and a precise cutting path is generated by offsetting a certain cutting margin along the binormal vector direction. This method automates the entire process from image acquisition, feature extraction, to path planning, significantly improving the accuracy and consistency of rainbow trout fillet anal fin recognition. It can effectively improve trimming efficiency. The rainbow trout fillet anal fin contour recognition method of this invention includes the following steps:
[0044] S1: Obtain the point cloud data of rainbow trout fillets on the conveyor belt, specifically including:
[0045] After being sliced, the rainbow trout fillets are placed on the conveyor belt of the trimming equipment and transported to the trimming station at a constant speed V to achieve the feeding and conveying of the fillets. When the fillet reaches point A (image acquisition point A) on the conveyor belt, a fixedly installed multispectral camera acquires color point cloud data of the fillet and obtains the three-dimensional coordinates of each point in the point cloud data in the camera coordinate system. An initial coordinate transformation is performed through a pre-calibrated transformation matrix to transform the point cloud from the camera coordinate system to the trimming equipment coordinate system, laying the foundation for subsequent processing.
[0046] In one specific embodiment, the time when the rainbow trout fillet passes point A is... A multispectral camera acquires point clouds of fish fillets, obtaining the coordinates of each point in the camera coordinate system. The coordinates in the middle are:
[0047]
[0048] in: The total number of points in the point cloud; : Homogeneous coordinates (4-dimensional vector) of the i-th point in the camera coordinate system; : The X coordinate of the i-th point in the camera coordinate system; : The Y-coordinate of the i-th point in the camera coordinate system; : The Z coordinate (depth value) of the i-th point in the camera coordinate system; : Index of points in the point cloud, from 1 to N; superscript : This indicates that the quantity belongs to the camera coordinate system.
[0049] The transformation matrix from the camera to the coordinate system of the trimming equipment is obtained through camera calibration:
[0050]
[0051] in: : A 4×4 homogeneous transformation matrix, representing the transformation from the camera coordinate system to the trimming device coordinate system; : A 3×3 rotation matrix that describes the rotation relationship from the camera coordinate system to the trimming equipment coordinate system; : A 3×1 translation vector, representing the position of the camera coordinate system origin in the trimming device coordinate system; : A zero vector with 1 row and 3 columns; superscript : Indicates the coordinate system of the maintenance equipment; subscript : Represents the camera coordinate system.
[0052] S2: Preprocess the point cloud data to obtain the fish fillet point cloud and establish the fish fillet coordinate system, specifically including:
[0053] During preprocessing, statistical filtering is used to remove outliers, and the point cloud of the main body of the fish fillet is retained as the fish fillet point cloud; the centroid of the point cloud is calculated, and the principal axis direction of the fish fillet is determined by principal component analysis (PCA).
[0054] In one specific embodiment, statistical filtering is used to remove outliers, resulting in the point cloud of the fish fillet body, expressed as:
[0055]
[0056] in: : The point cloud set of the main body of the fish fillet after filtering in the coordinate system of the trimming equipment; : The coordinates of the i-th point in the coordinate system of the trimming equipment; : The number of points in the filtered point cloud; : The number of points in the original point cloud.
[0057] In establishing the fish fillet coordinate system, the centroid of the fish fillet point cloud is taken as the origin, and the three orthogonal directions with the largest variance found by principal component analysis (three orthogonal eigenvectors, corresponding to three eigenvalues) are used as the coordinate axes. The coordinate system is then established by recording the values at this point. The position of the origin of the fish fillet coordinate system in the coordinate system of the trimming equipment.
[0058] In one specific embodiment, the expression for calculating the centroid of the fish fillet point cloud is:
[0059]
[0060] in: The center of gravity (centroid) of the fish fillet point cloud in the coordinate system of the trimming equipment; The number of points in the fish fillet point cloud; : No. The coordinates of each point in the coordinate system of the trimming equipment; Summation symbol: sum all points.
[0061] Calculate the covariance matrix:
[0062]
[0063] in: : A 3×3 covariance matrix, describing the distribution of the fish fillet point cloud in three dimensions; : The coordinates of the i-th point in the coordinate system of the trimming equipment; : Dot cloud center of gravity; :vector The transpose of ; the summation symbol: sums all points.
[0064] Perform eigenvalue decomposition on the covariance matrix:
[0065]
[0066] in The corresponding feature vector is . Covariance matrix; The j-th feature value, sorted in descending order; : Corresponding eigenvalues eigenvectors (unit vectors); : The index of the eigenvalue / eigenvector, with values of 1, 2, and 3.
[0067] Define the fish fillet coordinate system, and its transformation matrix relative to the trimming equipment coordinate system is:
[0068]
[0069] in: A 4×4 homogeneous transformation matrix, representing the transformation over time. The transformation from the fish fillet coordinate system to the trimming equipment coordinate system; The eigenvector corresponding to the largest eigenvalue is used as the X-axis (direction of the main axis of the fish fillet) of the fish fillet coordinate system. The eigenvector corresponding to the second largest eigenvalue is used as the Y-axis of the fish fillet coordinate system. The eigenvector corresponding to the smallest eigenvalue is used as the Z-axis of the fish fillet coordinate system (perpendicular to the surface of the fish fillet). The centroid of the point cloud serves as the origin of the fish fillet coordinate system. : Image acquisition time; Subscript F: Indicates the fish fillet coordinate system.
[0070] The inverse transformation matrix from the fish fillet coordinate system to the trimming equipment coordinate system is:
[0071]
[0072] in: A 4×4 homogeneous transformation matrix, representing the transformation over time. The transformation from the coordinate system of the trimming equipment to the coordinate system of the fish fillet; : The inverse matrix; : Feature vector The transpose of (row vector); :vector and The dot product of these terms, multiplied by -1, becomes the X component of the translation vector; similarly, and These are the Y and Z components of the translation vector, respectively.
[0073] Transform the fish fillet point cloud from the trimming equipment coordinate system to the fish fillet coordinate system:
[0074]
[0075] in: : The coordinates of the i-th point in the fish fillet coordinate system; Transformation matrix from the equipment coordinate system to the fish fillet coordinate system; The i-th point in time The coordinates in the equipment coordinate system at that time; superscript : Represents the coordinate system of the fish fillet.
[0076] S3: Identify anal fin features and extract anal fin contours based on the point cloud of the fish fillet.
[0077] S31: For each point in the fish fillet point cloud in the fish fillet coordinate system, calculate its normal vector and curvature.
[0078] In one specific embodiment, for a certain point in the fish fillet point cloud In the process of calculating the normal vector, the k-nearest neighbor algorithm is used to find its neighborhood point set:
[0079]
[0080] in: : The i-th point in the fish fillet coordinate system, a three-dimensional coordinate vector; : The X, Y, Z coordinates of the i-th point in the fish fillet coordinate system; : The set of neighboring points of the i-th point; : The j-th point; : Neighborhood search radius; :point and points The Euclidean distance between them.
[0081] Calculate the covariance matrix of the neighborhood points:
[0082]
[0083] in: : The 3×3 covariance matrix of the neighborhood points of the i-th point; Neighborhood Number of midpoints; : To the neighborhood Sum all points in the summation; A point in the neighborhood; Neighborhood The center of gravity (center of mass); :vector The transpose of . It is the neighborhood centroid, and its expression is:
[0084]
[0085] in: : The centroid (centroid) of the neighborhood of the i-th point; : Number of points in the neighborhood; : Summing the coordinates of all points in the neighborhood.
[0086] Perform eigenvalue decomposition on the covariance matrix:
[0087]
[0088] in: : The covariance matrix of the i-th point; The k-th eigenvalue of the i-th point; : Corresponding eigenvalues eigenvectors (unit vectors); : The index of the eigenvalue / eigenvector, with values of 1, 2, and 3.
[0089] in The eigenvector corresponding to the smallest eigenvalue is the normal vector.
[0090]
[0091] in: The smallest eigenvalue of the covariance matrix at the i-th point; : Corresponding minimum eigenvalue eigenvectors; : The normal vector (unit vector) at the i-th point.
[0092] Fish slices dotted in the clouds, dots The curvature at a given point is calculated using eigenvalues, and its expression is:
[0093]
[0094] in: : The curvature estimate at the i-th point; Minimum eigenvalue; Intermediate eigenvalues; : Maximum eigenvalue; denominator The sum of the three eigenvalues represents the total variance of the neighborhood of a point.
[0095] S32: Based on the curvature threshold, height threshold, and width threshold, filter out the point cloud set belonging to the anal fin from the fish fillet point cloud to achieve anal fin region recognition.
[0096] In one specific embodiment, the anal fin is located on the abdomen of the fish fillet and has specific curvature and positional characteristics. The selection rule for the anal fin region used in this embodiment is as follows:
[0097]
[0098] in: Point cloud set of the anal fin region; : The i-th point; : The curvature of the i-th point; Anal fin curvature threshold (usually taken as 0.01-0.03); Z-coordinate (height) of the i-th point; Height threshold, used to distinguish between the anal fin (lower region) and the dorsal fin (higher region). : The Y-coordinate (width direction) of the i-th point; : The absolute value of the Y coordinate, because the anal fin is usually located on both sides of the fish fillet; Width threshold: Used to limit the position of the anal fin in the width direction of the fish fillet.
[0099] S33: After obtaining the point cloud set of the anal fin region, select a starting point located in or near the anal fin region from the point cloud corresponding to the anal fin region as a seed point. In specific implementation, it is preferable to select the point with the lowest vertical height. Use the region growing algorithm to obtain the point set of the anal fin region and use the point cloud boundary extraction algorithm to extract the boundary point set from it as the anal fin contour.
[0100] In one specific embodiment, the expression for selecting the seed point is:
[0101]
[0102] During the region growth process, at each time step, potential growth points are selected based on the seed point (first time step) or the current growth point (subsequent time steps) and the region growth conditions. The region growth conditions are:
[0103]
[0104] in: Seed points for regional growth; Find the point with the smallest Z-coordinate in the anal fin point cloud set; : The maximum distance for neighborhood search during region growth; :point and points The normal vector; The dot product of two normal vectors; : The cosine value of the maximum permissible angle difference (angle cosine threshold). It is the maximum permissible angle difference. Indicates the seed point or current growth point. Indicates the point to be grown.
[0105] Through the aforementioned region growth process, a connected point cloud (anal fin region point set) of the anal fin region, consisting of points that meet the growth conditions, is obtained. Subsequently, the outer contour point set is extracted from this connected point cloud as the final anal fin contour. The specific extraction method is as follows: traverse each point in the connected point cloud of the anal fin region; if any neighboring point of this point (e.g., its k-nearest neighbor) does not belong to the connected point cloud of the anal fin region, then this point is determined to be a boundary point; the set of all boundary points is denoted as the anal fin contour point set.
[0106] S4: Plan the cutting path based on the anal fin outline in the fish fillet point cloud, specifically including:
[0107] S41: Perform least-squares fitting on the anal fin profile to obtain the profile curve.
[0108] In one specific embodiment, the anal fin boundary is relatively complex. To facilitate subsequent cutting, a polynomial curve fitting is used:
[0109]
[0110] in: :parameter The corresponding point on the polynomial curve of the anal fin; : Polynomial coefficients (three-dimensional vector); Curve parameters, with values ranging from 0 to 1; The sum of the squares and cubes of the parameters; This is the coefficient vector.
[0111] The coefficients are solved using the least squares method, and the expression is as follows:
[0112]
[0113] in: Minimize the set of coefficients of a polynomial The objective function; Summing over all anal fin boundary points; : The square of the distance between the j-th boundary point and its corresponding point on the polynomial curve; Number of boundary points of the anal fin.
[0114] Transform the solution into a linear system:
[0115]
[0116] Where: Left side matrix: Design matrix, size is Each row corresponds to the power of the parameter of a point; : The parameter value of the j-th point; : The sum of squares and cubes of the parameter values; Intermediate matrix: the transpose of the coefficient matrix, with a size of Each row is the transpose of a coefficient vector; the right-hand matrix is the boundary point coordinate matrix, with a size of... Each row represents the coordinate transpose of a boundary point.
[0117] S42: Offset the fitted contour curve outwards from the anal fin region by a predetermined distance as a margin, and use the offset contour curve as the cutting path.
[0118] In one specific embodiment, for points on the fitted contour curve Offset by a predetermined distance along the normal vector direction As a cutting allowance:
[0119]
[0120] in: Points on the offset cutting path; Points on the original fitted curve (profile curve); Cutting allowance (usually 1-2mm), positive numbers indicate outward offset, negative numbers indicate inward offset; :point The unit normal vector at that location.
[0121] normal vector The normal vector can be calculated from the tangent vector using curve differentiation: for a contour curve expressed in parametric curve form. The tangent vector is:
[0122]
[0123] in: : The curve in the parameter The tangent vector at point (first derivative); : Curve coordinate components relative to parameters The derivative of .
[0124] S43: Calculate the total length of the cutting path and determine the cutting time based on the cutting speed of the cutting device. Time mapping relationship with path parameters:
[0125] In one specific embodiment, for the contour curve expressed in the form of a parametric curve. Arc length calculation formula:
[0126]
[0127] in: The total arc length of the curve; : For parameters Integral from 0 to 1; : The curve in the parameter The first derivative (tangent vector) at the point; The magnitude of the tangent vector (i.e., the length of the curve at...) (The instantaneous velocity at that point).
[0128] Cutting time The expression is:
[0129]
[0130] in: : The total time required to complete the entire cut; : Total length of the cutting path; Cutting speed (constant value).
[0131] Path parameters of the profile curve With time The mapping relationship is as follows:
[0132]
[0133] in: :time The corresponding path parameter values; Total path length; For arc lengths from 0 to integral; :time The distance the internal trimmer moves; this formula indicates that under uniform cutting conditions, the relationship between the path parameter u and time t is determined by the arc length parameterization.
[0134] This invention relates to an intelligent trimming system based on 3D point clouds and an adaptive coordinate system. It employs a multispectral camera to acquire color point clouds, achieving high-precision reconstruction of the 3D contours of fish fillets. A dynamic coordinate system establishment method for fish fillets is proposed, automatically determining the principal axis direction and orientation of the fillets through principal component analysis (PCA), adapting to individual differences in each fish fillet.
[0135] This invention proposes a multi-feature anal fin region recognition method based on curvature threshold, height threshold, and width threshold. A region growing algorithm combined with normal vector consistency is used to extract the anal fin region point set, and then a mature point cloud boundary extraction algorithm is employed to obtain the anal fin contour boundary, improving the accuracy and robustness of contour extraction. A polynomial fitting and normal offset cutting path generation method is also used.
[0136] This invention uses a polynomial curve to fit the anal fin contour and combines it with the least squares method to optimize the fitting accuracy. A cutting allowance compensation method based on the secondary normal vector is proposed to ensure that the cutting path conforms to both the geometry of the fish fillet and the process allowance requirements.
[0137] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
Claims
1. A method for recognizing the anal fin contour of a rainbow trout fillet, characterized in that, include: S1: Acquire point cloud data of the fish fillet and transform the point cloud data from the camera coordinate system to the trimming device coordinate system; S2: Preprocess the converted point cloud data to obtain the fish slice point cloud, calculate the principal axis direction of the fish slice point cloud using principal component analysis, and establish a fish slice coordinate system that follows the posture of the fish slice. S3: Extract the anal fin contour in the fish fillet coordinate system, which includes: calculating the normal vector and curvature of each point in the fish fillet point cloud; Based on preset curvature threshold, height threshold, and width threshold, a set of point clouds belonging to the anal fin region is selected from the fish fillet point cloud; seed points are selected from the point cloud set, and region growth is performed based on the consistency of spatial distance and normal vector of the point cloud to obtain the anal fin region point set and extract the anal fin contour from it.
2. The method for recognizing the anal fin contour of a rainbow trout fillet according to claim 1, characterized in that: In step S1, statistical filtering is used to remove outliers to obtain the fish slice point cloud.
3. The method for recognizing the anal fin contour of a rainbow trout fillet according to claim 1, characterized in that: The process of establishing the fish fillet coordinate system in step S2 specifically includes: S21: Calculate the centroid of the fish fillet point cloud in the coordinate system of the trimming equipment; S22: Calculate the covariance matrix of the fish fillet point cloud and perform eigenvalue decomposition on the covariance matrix to obtain three eigenvalues and their corresponding eigenvectors. S23: Establish the fish fillet coordinate system with the centroid as the origin, the eigenvector corresponding to the largest eigenvalue as the X-axis, the eigenvector corresponding to the second largest eigenvalue as the Y-axis, and the eigenvector corresponding to the smallest eigenvalue as the Z-axis, and take the X-axis as the principal axis direction; S24: Record the position of the origin of the fish fillet coordinate system in the trimming device coordinate system at the moment of image acquisition.
4. The method for recognizing the anal fin contour of a rainbow trout fillet according to claim 1, characterized in that: In step S3, the method for calculating the normal vector and curvature of any point in the fish fillet point cloud is as follows: Search this point Nearest neighbor set; Calculate the Find the covariance matrix of the nearest neighbor set of points, and calculate the eigenvalues of this covariance matrix. , , ,in: ; Take the smallest eigenvalue The corresponding eigenvector is used as the normal vector of that point. And calculate the curvature at that point: ; in: For curvature.
5. The method for recognizing the anal fin contour of a rainbow trout fillet according to claim 1, characterized in that: In step S3, the criteria for selecting the point cloud set belonging to the anal fin region from the fish fillet point cloud include: in: The point cloud set for the anal fin region; For the first One point; For the first Curvature at a point; The threshold value for anal fin curvature; Let Z be the Z coordinate of the i-th point; The height threshold; Let be the y-coordinate of the i-th point; This is the width threshold.
6. The method for recognizing the anal fin contour of a rainbow trout fillet according to claim 1, characterized in that: In step S3, the region growth process includes: selecting a seed point from the point cloud set of the anal fin region; filtering the points to be grown based on the seed point or the current growth point and the growth conditions; finally obtaining the point set of the anal fin region and using a point cloud boundary extraction algorithm to obtain the anal fin contour from the point set of the anal fin region; the growth conditions include: the Euclidean distance between the point to be grown and the seed point or the current growth point is less than the maximum distance. And the normal vector of the point to be grown. Normal vector of seed point or current growth point The dot product is greater than the preset angle cosine threshold. .
7. The method for recognizing the anal fin contour of a rainbow trout fillet according to claim 1, characterized in that: This also includes performing least-squares fitting on the extracted anal fin contour to obtain the contour curve: During the least-squares fitting process, polynomial curve fitting is used. ; in: For parameters The corresponding point on the polynomial curve of the anal fin; These are the polynomial coefficients; These are curve parameters, with values ranging from 0 to 1; For the squares and cubes of the parameters; For coefficient vectors; The coefficients are solved using the least squares method, and the expression is as follows: ; in: To minimize the set of polynomial coefficients The objective function; The square of the distance between the j-th boundary point and its corresponding point on the polynomial curve; This represents the number of boundary points of the anal fin.
8. The method for recognizing the anal fin contour of a rainbow trout fillet according to claim 7, characterized in that, It also includes generating a cutting path based on the contour curve. During the cutting path generation process, the fitted contour curve is offset outward by a predetermined distance as a margin, and the offset contour curve is used as the cutting path.
9. A trimming device, characterized in that: The anal fin outline and cutting path of the rainbow trout fillet are obtained by the method of claims 1 to 8, and the anal fin of the rainbow trout fillet is cut along the cutting path.
10. The trimming equipment according to claim 9, characterized in that, It includes a multispectral camera; the trimming device acquires point cloud data of rainbow trout fillets using the multispectral camera.