Method and device for detecting geometric defects of a shaped fish fillet profile, and medium

By employing geometric analysis algorithms and image processing technology, the problems of high cost and poor flexibility in fish fillet inspection have been solved, achieving high-precision and stable defect detection for shaped fish fillets, adapting to different production needs.

CN122156045APending Publication Date: 2026-06-05SHANGHAI XIXI INTELLIGENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI XIXI INTELLIGENT TECH CO LTD
Filing Date
2026-01-12
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing methods for detecting defects in fish rafts rely on deep learning models, which require a lot of time and cost and have poor flexibility, making it difficult to meet the requirements of high accuracy and stability. Traditional methods are also difficult to cope with changes in the position and angle of the fish rafts and lack a complete solution for detecting shape and edge defects.

Method used

A geometric analysis algorithm is used to obtain the edge contour point set of the fish raft image, perform pose standardization processing, determine geometric feature points, and perform overall shape and local defect detection, including overall angle and local concavity and convexity detection. By combining deep learning and traditional image processing techniques, the cost of data acquisition and model training is reduced, and the detection flexibility and stability are improved.

Benefits of technology

It achieves high precision and robustness in millimeter-level defect detection, reduces deployment costs and time, adapts to different production needs, and provides comprehensive quality control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122156045A_ABST
    Figure CN122156045A_ABST
Patent Text Reader

Abstract

The application provides a method and device for detecting geometric defects of a shaped fish fillet profile and a medium. The method comprises: acquiring an image of a shaped fish fillet to be detected and extracting an edge contour point set thereof; performing posture standardization processing on the edge contour point set to obtain a posture-corrected contour; determining at least three preset geometric feature points on the corrected contour; performing first geometric defect detection based on a first point set to determine whether there is an overall shape defect; fitting a first reference geometric curve based on a second point set, and performing second geometric defect detection by calculating the distance deviation of points on the corrected contour from the reference geometric curve to determine whether there is a local concave-convex defect. The application does not require a trained model, has low cost and high flexibility, and realizes comprehensive defect detection with high precision and high robustness through posture correction and accurate geometric calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of image processing and computer vision technology, and in particular to a method for detecting geometric defects in the outline of a shaped fish fillet. Background Technology

[0002] In the industrial production of food products such as fish fillets, the process typically involves raw material processing, cutting, battering, coating with flour, and shaping. After cutting and shaping, the fish fillets develop a specific rhomboid shape. To ensure product quality and standardization, the shape of the fish fillets needs to be inspected. Existing defect detection methods mainly rely on deep learning models. These methods require significant time and cost for collecting massive amounts of image data and manual annotation. Furthermore, when the defect evaluation criteria change, data often needs to be re-annotated and the model retrained, resulting in poor flexibility and high maintenance costs. In addition, for millimeter-level defects, manual annotation itself introduces errors, making it difficult for the trained model to meet high accuracy standards. Other methods based on traditional image processing, while avoiding model training, often struggle to effectively address the issue of fish fillets being placed at variable positions and angles on conveyor belts, leading to unstable and unreliable detection results. Moreover, they lack a comprehensive solution capable of simultaneously and accurately quantifying both overall shape deviations and local edge defects. Summary of the Invention

[0003] To address the shortcomings of existing technologies, the purpose of this invention is to provide a method, apparatus, and medium for detecting geometric defects in the contour of shaped fish fillets.

[0004] A method for detecting geometric defects in the contour of a shaped fish fillet according to the present invention includes the following steps: Acquire an image of the fish fillet to be shaped, and extract the set of edge contour points representing the shape of the fish fillet from the image; The edge contour point set is subjected to pose normalization processing to obtain the pose-corrected contour; On the posture-corrected contour, at least three preset geometric feature points are determined for geometric analysis; Based on a first point set containing at least three points selected from the preset geometric feature points, a first geometric defect detection is performed to determine whether the fish fillet has an overall shape defect. Based on a second set of points selected from the preset geometric feature points, containing at least three points, a first reference geometric curve is fitted. Then, by calculating the distance deviation between the points on the posture-corrected contour and the first reference geometric curve, a second geometric defect detection is performed to determine whether the fish fillet has local concave or convex defects.

[0005] Preferably, the extraction of the edge contour point set specifically includes: The image is processed using a semantic segmentation network to obtain the pixel mask of the fish raft, and the edge contours are extracted from the pixel mask.

[0006] Preferably, the extraction of the edge contour point set specifically includes: The image is subjected to grayscale, binarization, and morphological processing to obtain the pixel mask of the fish raft, and the edge contour is extracted from the pixel mask.

[0007] Preferably, the attitude standardization process specifically includes: Calculate the principal direction of the edge contour point set, and rotate the edge contour point set to align the principal direction with the coordinate system axis; The main direction is calculated using one of the following methods: principal component analysis; or determined based on the minimum area bounding rectangle of the edge contour point set.

[0008] Preferably, the preset geometric feature points are the four extreme points of the posture-corrected contour on the x-axis and y-axis.

[0009] Preferably, the first geometric defect detection specifically includes: Based on the four extreme points, calculate the upper angle formed by the extreme point located on the positive half of the y-axis and the two extreme points located on the x-axis, and / or the lower angle formed by the extreme point located on the negative half of the y-axis and the two extreme points located on the x-axis, and compare it with a preset angle range.

[0010] Preferably, the first reference geometry curve is one of the following: The arc determined by three of the four extreme points; A spline curve fitted based on the four extreme points and / or other points on the posture-corrected contour.

[0011] A geometric defect detection device for shaping fish fillet contours according to the present invention includes: An image input unit is used to acquire an image of the fish fillet to be shaped; Memory, used to store computer programs; A processor is configured to, when executing the computer program, implement the geometric defect detection method for the shaped fish fillet contour as described in claim 1.

[0012] Preferably, the image input unit is an image acquisition device.

[0013] According to the present invention, a computer-readable storage medium is provided thereon storing a computer program, which, when executed by a processor, implements the geometric defect detection method for the contour of the fish fillet.

[0014] Compared with the prior art, the present invention has the following beneficial effects: 1. This application is based on geometric analysis algorithms, which eliminates the need for time-consuming and labor-intensive data collection, annotation and model training, significantly reducing deployment costs and time. Moreover, the defect standard can be adjusted as a parameter at any time to adapt to different production needs, making it highly flexible.

[0015] 2. This invention effectively eliminates the interference of changes in the placement and angle of the fish racks on the detection results through the contour posture correction step, ensuring the stability and robustness of the detection. Based on precise geometric calculations, it can achieve millimeter-level defect detection.

[0016] 3. This method can simultaneously quantify and evaluate the overall shape and local details of the fish fillet, providing a more comprehensive means of quality control. Attached Figure Description

[0017] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a schematic diagram illustrating the extraction of edge contours from the pixel region of the fish raft, as provided in an embodiment of this application. Figure 2 This is a schematic diagram illustrating the posture correction of the fish fillet outline provided in an embodiment of this application; Figure 3 A schematic diagram illustrating overall angular defect detection provided in an embodiment of this application; Figure 4 This is a schematic diagram of local concave-convex defect detection provided in an embodiment of this application; Figure 5 A flowchart illustrating a method for detecting geometric defects in the contour of a fish fillet, as provided in an embodiment of this application; Figure 6 This is a schematic diagram of the implementation environment for a geometric defect detection device for shaping fish fillet contours, provided in an embodiment of this application.

[0018] Explanation of reference numerals in the attached figures: 100. Conveyor belt; 110. Fish raft to be tested; 120. Image acquisition device; 130. Computer processing unit; 140. Control output interface. Detailed Implementation

[0019] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.

[0020] Example 1 This application provides a method and apparatus for detecting geometric defects in the contour of shaped fish fillets. Specifically, this approach, based on a strategy combining deep learning and geometric analysis, achieves automated, high-precision, and highly robust defect detection.

[0021] Figure 6 A typical detection apparatus applicable to the methods of the embodiments of this application is shown. The apparatus is deployed on a food processing production line and includes a conveyor belt 100 for uniformly conveying products, on which one or more fish fillets 110 to be tested are placed. An image acquisition device 120, such as a megapixel industrial area scan camera, is fixedly mounted above the conveyor belt 100, its lens field of view covering the effective width of the conveyor belt 100. The image acquisition device 120 is connected to a computer processing unit 130 via a data cable (such as a gigabit Ethernet cable or a USB 3.0 data cable). The computer processing unit 130 can be an industrial personal computer, an embedded system, or a workstation with corresponding computing capabilities, and integrates core components such as a processor and memory. The memory pre-stores computer program instructions for implementing the methods of this application, and the processor executes these instructions to analyze and process the image data received from the image acquisition device 120. In addition, the computer processing unit 130 is also equipped with a control output interface 140, which can be connected to other control devices on the production line (such as alarm lights, audible alarms, or solenoid valves of pneumatic rejection devices) for marking or physically separating non-conforming products based on the test results.

[0022] Figure 5 This is a flowchart illustrating a detection method provided in one embodiment of this application. In this embodiment, the detection process can be automatically executed by the computer processing unit 130, and specifically includes the following steps: Step S10: Image Acquisition. When the fish raft 110 under test enters the field of view of the image acquisition device 120 along with the conveyor belt 100, the image acquisition device 120 is triggered by an external trigger signal (such as a photoelectric sensor) or an internal timing mechanism to capture a digital image containing the fish raft 110 under test. This digital image can be a color image or a grayscale image, and has a resolution sufficient to resolve millimeter-level details, such as 2048x1536 pixels. Subsequently, the acquired image data is transmitted in real time to the computer processing unit 130 as input for subsequent processing.

[0023] Step S20: Extract edge contours. This step aims to accurately separate the fish fillets from a complex background and obtain a mathematical representation of their edge contours. In this embodiment, this step employs a deep learning-based semantic segmentation technique to achieve extremely high segmentation accuracy and robustness. Specifically, the acquired image of the fish fillet 110 to be tested is input into a semantic segmentation network model (e.g., a neural network with a UNet architecture) pre-loaded into the computer processing unit 130. This model, trained on a large number of fish fillet images, is able to accurately identify the fish fillet pixels and background pixels in the image.

[0024] After forward propagation, the model outputs a probability map of the same size as the original image, where each pixel value represents the probability that the pixel belongs to a fish raft. By setting a probability threshold (e.g., 0.5), this probability map can be converted into a binary image, where areas with a pixel value of 1 (or 255) represent fish rafts, and areas with a pixel value of 0 represent the background. This region containing only fish raft pixels is the [image / image / data]. Figure 1 The pixel area of ​​the fish raft shown.

[0025] Next, an edge detection algorithm (such as the contour finding algorithm proposed by Suzuki et al.) is applied to the binary image to extract the boundaries of the fish fillet pixel region, thereby obtaining an original contour composed of a series of ordered pixel coordinates (x, y), as shown below. Figure 2 As shown. Thus, the physical fish-scale shape has been successfully converted into a computer-processable digital geometric object.

[0026] Step S30: Contour pose correction. To eliminate the influence of the random placement and angle of the fish raft 110 on the conveyor belt 100 on subsequent measurements, the extracted original contour needs to be pose standardized. In this embodiment, principal component analysis is used to determine and correct the principal direction of the contour.

[0027] First, treat the coordinates of all points on the original contour as a two-dimensional dataset and calculate the geometric center point (centerX, centerY) of this dataset. This center point can be obtained by calculating the average of the x-coordinates and the average of the y-coordinates of all points, or it can be approximated by the center of its bounding box.

[0028]

[0029] Wherein, minx, maxx, miny, and maxy are the minimum and maximum x and y coordinates of all points in the original contour, respectively.

[0030] Then, principal component analysis is performed on the dataset. Specifically, the covariance matrix of the point set is calculated, and the eigenvalues ​​and eigenvectors of the matrix are solved. The eigenvector corresponding to the largest eigenvalue indicates the direction of maximum data variance; this direction is... Figure 2 The principal direction of the original contour shown is given. This principal direction vector can be represented as (m, n).

[0031] After obtaining the principal direction vector, calculate the angle between it and the preset standard direction (e.g., the negative Y-axis direction of the coordinate system, i.e., vector (0, -1)). Then, using the geometric center point (centerX, centerY) as the rotation center, rotate each point (xi, yi) on the original contour by -angle degrees using the following coordinate transformation formula, so that its principal direction is aligned with the Y-axis:

[0032]

[0033] Where (Xi, Yi) are the new coordinates after the transformation. After this step, regardless of how the original fish rafts are placed, their transformed outlines will exhibit a uniform posture (e.g., the major axis is vertical), thus obtaining the following... Figure 2 The corrected profile is shown. This step is crucial to ensuring the repeatability and reliability of all subsequent measurements.

[0034] After obtaining the corrected contour, the contour can be translated again to facilitate subsequent calculations so that its geometric center is located at the origin (0,0).

[0035] Step S40: Overall Angle Defect Detection. This step aims to evaluate whether the overall shape of the fish fillet conforms to the preset rhombus standard. Geometric feature points can be easily determined on the corrected contour with uniform posture. In this embodiment, these preset geometric feature points are defined as the four extreme points of the contour on the X and Y axes. Specifically, by traversing all points of the corrected contour, the following are found: - The point with the smallest Y coordinate, denoted as extreme point p0; - The point with the largest X coordinate, denoted as extreme point p1; - The point with the largest Y coordinate, denoted as extreme point p2; - The point with the smallest X coordinate, denoted as extreme point p3. It can be understood that these four extreme points p0, p1, p2, and p3 approximately constitute the four rhombus vertices of the fish fillet, as shown below. Figure 3 As shown.

[0036] Based on these four extreme points, two key angles characterizing the overall shape of the fish fillet can be calculated: the upper included angle (∠p1p0p3) and the lower included angle (∠p1p2p3). Taking the calculation of these angles as an example, the process is as follows: 1. Define two vectors pointing from vertex p0 to p1 and p3:

[0037] as well as,

[0038] 2. Calculate the dot product of these two vectors:

[0039] 3. Calculate the magnitudes of these two vectors:

[0040] as well as,

[0041] 4. Based on the geometric meaning of the dot product, calculate the included angle using the following formula: .

[0042] Similarly, the lower included angle can be calculated using the extreme points p2, p1, and p3. Correspondingly, the calculated upper and lower included angles are compared with the preset acceptable angle range std_angle[min_angle, max_angle]. For example, if the production standard requires the rhombus angle to be between 65 and 75 degrees, then min_angle = 65 and max_angle = 75. If either the calculated upper or lower included angle falls outside this range, the computer processing unit 130 determines that the fish fillet has an overall shape defect.

[0043] Step S50: Local Unevenness Defect Detection. This step aims to detect whether there are minor depressions or protrusions on the edge of the fish fillet. In one embodiment of this application, this detection is achieved based on fitting an ideal reference geometric curve and calculating the deviation of the contour points from it. Since the edge of the fish fillet is approximately an arc, a reference arc is fitted. The detection process is performed separately on the left and right halves of the fish fillet.

[0044] Taking the right half of the fish fillet (i.e., all points on the corrected contour with X coordinates greater than or equal to 0) as an example, the detection process is as follows: Figure 4 As shown, the details are as follows: 1. Fitting the First Reference Geometric Curve: Select three key points on the right half of the contour, namely the extreme points p0, p1, and p2, to define an ideal reference arc. By solving the equation of the circumcircle of these three points, the center coordinates (ox, oy) and radius (rad) of a reference circle can be uniquely determined. Let p0 = (x0, y0), p1 = (x1, y1), and p2 = (x2, y2). Solving for the center (ox, oy) is equivalent to solving the following system of linear equations: Once (ox, oy) is solved, the radius can be obtained: .

[0045] 2. Calculate distance deviation: Traverse each point contour[i] belonging to the right half of the corrected contour, and calculate the distance dist[i] from that point to the center of the calculated reference circle:

[0046] 3. Defect Identification: For each contour point, calculate its radial distance deviation from the ideal circumference, diff[i] = dist[i] - rad. If diff[i] is positive, it indicates that the point is outside the ideal arc and may constitute a convex defect; conversely, if diff[i] is negative, it indicates that the point is inside the ideal arc and may constitute a concave defect. Compare the absolute value of this deviation, |diff[i]|, with a preset defect size threshold. For example, if the standard stipulates that convex or concave defects with a depth or height exceeding 3 mm are not allowed, and considering measurement errors and allowable minor unevenness, an error range, thr (e.g., 0.5 mm), can be set. When |diff[i]| is greater than 3 mm, or more precisely, when |diff[i]| is not within a certain allowable fluctuation range (e.g., |diff[i]| > 0.5 mm), the point can be identified as a defect point. A defect area can be determined by consecutive defect points.

[0047] For the left half of the fish raft (points with X coordinates less than 0), the same method is used, using extreme points p0, p3, and p2 to fit the reference arc on the other side, and the same distance deviation calculation and defect judgment are performed.

[0048] Step S60: Output Results. After completing the overall angle defect detection and local unevenness defect detection, the computer processing unit 130 integrates all detection information to form a final judgment result. If both angles are within the acceptable range and no local unevenness defects exceeding the threshold are detected, the fish rack 110 to be tested is judged as a qualified product; otherwise, it is judged as an unqualified product. For unqualified products, a detailed defect report can be further generated, such as "upper angle out of tolerance" or "dimple on the right edge". The final judgment result is output through the control output interface 140, for example, outputting a high-level signal to the rejection device to remove the unqualified product from the conveyor belt 100.

[0049] This embodiment achieves high-precision and robust fish raft defect detection without requiring a large amount of labeled data and model training through the above steps, effectively solving the problems existing in the prior art.

[0050] Example 2 As an optional implementation, this embodiment provides a variation of the method for detecting geometric defects in the contour of shaped fish fillets. The overall process and most steps of this embodiment are basically the same as in Embodiment 1, with the main difference being the specific implementation of step S20, "extracting edge contours." This embodiment aims to provide a contour extraction scheme that does not rely on deep learning models and has lower computational overhead, suitable for hardware platforms with limited computing resources or application scenarios with relatively simple backgrounds.

[0051] In this embodiment, step S20 is implemented as follows: 1. Image preprocessing: The original image (whether color or grayscale) acquired from the image acquisition device 120 is first uniformly converted into a single-channel grayscale image.

[0052] 2. Image Binarization: An adaptive thresholding algorithm, such as Otsu's method, is applied to the grayscale image. This algorithm automatically analyzes the image's grayscale histogram to find an optimal global threshold, thus segmenting the image into foreground (fish rafts) and background. Compared to a fixed threshold, adaptive thresholding is more adaptable to changes in lighting. After binarization, a black and white image is obtained, where the fish raft area is presented as one color (e.g., white), and the background as another color (e.g., black).

[0053] 3. Morphological Processing: The binarized image may contain noise, such as isolated bright or dark spots, and holes within the fish fillet. To obtain a clean and complete fish fillet mask, morphological operations are required. First, an opening operation can be performed, i.e., erosion followed by dilation, to eliminate tiny bright spots smaller than the structuring element and restore the size of the eroded fish fillet body. Next, a closing operation can be performed, i.e., dilation followed by erosion, to fill the small holes inside the fish fillet and restore its outline to near its original size. After this series of processing, a smooth and complete fish fillet pixel region can be obtained.

[0054] 2. Contour extraction: Similar to Example 1, a contour search algorithm (such as the Suzuki algorithm) is applied to the morphologically optimized binary image to extract the ordered set of points representing the shape of the fish fillet, i.e., the original contour.

[0055] In this embodiment, after completing step S20, the principles, calculation methods, and judgment logic of subsequent steps S30 (contour pose correction), S40 (overall angle defect detection), S50 (local concavity / convexity defect detection), and S60 (output results) are completely identical to those described in Embodiment 1. By using traditional image processing techniques instead of deep learning networks, this embodiment significantly reduces the performance requirements of processors (especially graphics processing units) and dependence on specific software frameworks while ensuring a certain detection effect, providing greater flexibility for the deployment of this detection method.

[0056] Example 3 This embodiment provides another variation of the method for detecting geometric defects in the contour of shaped fish fillets. The overall framework of this embodiment is similar to that of Embodiments 1 and 2, with the core difference being the specific technical implementation of step S30, "contour posture correction," which aims to provide a computationally lighter posture determination method.

[0057] In Example 1, attitude correction was achieved through principal component analysis, which involves relatively complex computations. In this example, step S30 uses the method of calculating the minimum area bounding rectangle of the contour to determine its principal direction.

[0058] The specific implementation is as follows: 1. Obtain the original contour: First, complete steps S10 and S20 using the method in Example 1 or Example 2 to obtain the original contour to be processed.

[0059] 2. Calculate the minimum area bounding rectangle: For the original contour point set, apply an algorithm that can calculate its minimum area bounding rectangle, such as the rotating caliper algorithm. This algorithm can efficiently find a tilted rectangle with the minimum area that encloses all contour points.

[0060] 3. Determine the principal direction and rotation angle: The direction of the long side of the circumscribed rectangle with the smallest area can be considered as the principal direction of the fish fillet outline. The algorithm returns the center point, dimensions (length and width), and rotation angle of this rectangle. This rotation angle is the angle between the long side of the rectangle and the horizontal axis (X-axis) of the coordinate system, and serves as the angle that the entire outline needs to be corrected.

[0061] 4. Perform rotation transformation: Similar to Example 1, using the geometric center of the original contour (or the center of the smallest bounding rectangle) as the rotation center, rotate all points on the contour by the negative value of the angle determined in the previous step. This rotates the long side of the original rectangle until it is parallel to a coordinate axis (e.g., the X-axis or Y-axis). After the rotation transformation, a posture-normalized corrected contour is obtained.

[0062] Understandably, for a relatively regular rhomboid fish fillet, the principal direction determined by the minimum area bounding rectangle is very close to the principal direction calculated by principal component analysis. Therefore, both methods can achieve similar posture correction effects. Compared to performing a complete principal component analysis (which involves covariance matrix calculation and eigenvalue decomposition), the minimum area bounding rectangle algorithm is generally more computationally efficient and concise.

[0063] After completing step S30 of this embodiment, subsequent steps S40 (determining extreme points p0, p1, p2, p3 and performing angle detection) and S50 (fitting the reference arc and performing concavity / convexity detection) are all based on the corrected contour that has been standardized in posture, and their specific processes are completely consistent with those described in Embodiment 1. This embodiment provides an equivalent alternative for posture correction, which can be applied in scenarios where extreme processing speed is required.

[0064] Example 4 This embodiment provides another variation of the method for detecting geometric defects in the contour of shaped fish fillets. Its innovation mainly lies in the reference curve fitting method for step S50, "Detection of Local Concave and Concave Defects." Embodiment 1 assumes that the ideal edge of a fish fillet is a standard arc, but in actual production, the ideal edge of some products may itself be a more complex, smooth curve. This embodiment uses a fitted spline curve as a reference to improve adaptability to non-standard arc edge shapes.

[0065] The preliminary steps of this embodiment, including step S10 (image acquisition), S20 (edge ​​contour extraction), S30 (contour pose correction), and step S40 (overall angle defect detection), can be implemented using any combination of methods described in embodiments 1, 2, and 3. After obtaining the corrected contour and four extreme points p0, p1, p2, and p3, the specific implementation of step S50 is as follows: 1. Fitting the first reference geometric curve (spline curve): Taking the right half of the fish fillet as an example, instead of assuming its ideal edge is a circular arc, a series of control points that can represent its standard shape are selected to fit a more representative reference curve. These control points should at least include extreme points p0, p1, and p2. To make the fitted curve more closely resemble the ideal shape, several additional points can be selected uniformly or according to the curvature change on the corrected contour between p0 and p1, and between p1 and p2, as interpolation points or control points.

[0066] Based on these selected control points, a smooth curve is generated using a spline curve fitting algorithm (such as a B-spline curve or a non-uniform rational B-spline fitting algorithm). This spline curve represents the ideal, defect-free edge shape of this type of fish fillet, and it describes the inherent, non-circular curvature variation of the edge better than a single circular arc.

[0067] 2. Calculate distance deviation: Iterate through every actual contour point contour[i] on the right half of the corrected contour. For each point, calculate its shortest distance to the reference spline curve fitted in the previous step. This is a point-to-curve distance calculation problem, which usually requires iteratively solving a nonlinear equation to find the nearest point on the curve, and then calculating the Euclidean distance between the two points.

[0068] 3. Defect Identification: The calculated shortest distance is compared with a preset defect size threshold. This threshold represents the maximum allowable deviation perpendicular to the ideal edge, and can be set to, for example, 0.5 mm. If the shortest distance from a profile point to the reference spline curve exceeds this threshold, the point is identified as a local defect point, which may be a concave defect or a convex defect.

[0069] For the left half of the fish raft, the same method is used to fit the reference spline curve on the left side using extreme points p0, p3, p2 and other possible sampling points, and the same distance deviation calculation and defect judgment are performed.

[0070] This embodiment uses a more adaptable spline curve as a reference, which can more accurately identify local defects on non-standard arc edges, thereby effectively reducing misjudgments that may be caused by mismatch of the reference model (e.g., misjudging normal curvature changes as defects), and further improving the accuracy and reliability of local defect detection.

[0071] In summary, this application discloses a method for detecting geometric defects in shaped fish fillets through a preferred embodiment and various optional implementations. This method can exist as a standalone software module, stored on any computer-readable storage medium (such as a hard disk, solid-state drive, USB flash drive, or optical disk), and executed by a processor; it can also be combined with hardware to form a complete detection device, as shown in Embodiment 1. Figure 6 The system described herein acquires images through an image input unit (i.e., image acquisition device 120), and a detection method is executed by a computer processing unit 130 containing a processor and memory, ultimately achieving automatic monitoring of the quality of fish fillets on the production line.

[0072] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.

Claims

1. A method for detecting geometric defects in the contour of shaped fish fillets, characterized in that, Includes the following steps: Acquire an image of the fish fillet to be shaped, and extract the set of edge contour points representing the shape of the fish fillet from the image; The edge contour point set is subjected to pose normalization processing to obtain the pose-corrected contour; On the posture-corrected contour, at least three preset geometric feature points are determined for geometric analysis; Based on a first point set containing at least three points selected from the preset geometric feature points, a first geometric defect detection is performed to determine whether the fish fillet has an overall shape defect. Based on a second set of points selected from the preset geometric feature points, containing at least three points, a first reference geometric curve is fitted. Then, by calculating the distance deviation between the points on the posture-corrected contour and the first reference geometric curve, a second geometric defect detection is performed to determine whether the fish fillet has local concave or convex defects.

2. The method for detecting geometric defects in the contour of shaped fish fillets according to claim 1, characterized in that, The extraction of the edge contour point set specifically includes: The image is processed using a semantic segmentation network to obtain the pixel mask of the fish raft, and the edge contours are extracted from the pixel mask.

3. The method for detecting geometric defects in the contour of shaped fish fillets according to claim 1, characterized in that, The extraction of the edge contour point set specifically includes: The image is subjected to grayscale, binarization, and morphological processing to obtain the pixel mask of the fish raft, and the edge contour is extracted from the pixel mask.

4. The method for detecting geometric defects in the contour of shaped fish fillets according to claim 1, characterized in that, The attitude standardization process specifically includes: Calculate the principal direction of the edge contour point set, and rotate the edge contour point set to align the principal direction with the coordinate system axis; The main direction is calculated using one of the following methods: principal component analysis; or determined based on the minimum area bounding rectangle of the edge contour point set.

5. The method for detecting geometric defects in the contour of shaped fish fillets according to claim 4, characterized in that, The preset geometric feature points are the four extreme points of the posture-corrected contour on the x-axis and y-axis.

6. The method for detecting geometric defects in the contour of shaped fish fillets according to claim 5, characterized in that, The first geometric defect detection specifically includes: Based on the four extreme points, calculate the upper angle formed by the extreme point located on the positive half of the y-axis and the two extreme points located on the x-axis, and / or the lower angle formed by the extreme point located on the negative half of the y-axis and the two extreme points located on the x-axis, and compare it with a preset angle range.

7. The method for detecting geometric defects in the contour of shaped fish fillets according to claim 5, characterized in that, The first reference geometry curve is one of the following: The arc determined by three of the four extreme points; A spline curve fitted based on the four extreme points and / or other points on the posture-corrected contour.

8. A geometric defect detection device for shaping fish fillet contours, characterized in that, include: An image input unit is used to acquire an image of the fish fillet to be shaped; Memory, used to store computer programs; A processor is configured to, when executing the computer program, implement the geometric defect detection method for the shaped fish fillet contour as described in claim 1.

9. The apparatus according to claim 8, characterized in that, The image input unit is an image acquisition device.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the geometric defect detection method for the shaped fish fillet contour as described in claim 1.