A fish feed post-cooling breakage recognition method based on machine vision
By acquiring continuous images during the conveying process of fish feed after cooling, and using information such as end position, direction, and contour, combined with conveying motion compensation, a break-end continuation map is constructed, which solves the problem of accuracy in fish feed damage identification and achieves more reliable quality control.
Patent Information
- Application Number
- CN202611418857.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-11-27
AI Technical Summary
Existing technologies make it difficult to accurately identify whether multiple fish feed fragments belong to the same breakage event during the transportation process after fish feed has cooled, leading to discrepancies between test results and actual conditions.
By acquiring continuous images of cooled fish feed, and using information such as end position, orientation, adjacent width, and contour, combined with conveying motion compensation, the continuity relationship between image regions before breakage is established, and a breakage continuation map is constructed to identify breakage events.
It improves the accuracy of fish feed damage identification, reduces misjudgments, and provides more reliable quality control data.
Smart Images

Figure CN123181384A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision inspection technology, and more specifically, to a machine vision-based method for identifying damage to fish feed after cooling. Background Technology
[0002] After pelleting, drying, and cooling, fish feed is typically conveyed to grading or packaging stations. During the cooling process, as well as during transfer and continuous conveying, the fish feed pellets are subjected to collisions and compression, potentially breaking into two or more fragments. Production personnel need to monitor the breakage situation after cooling to assess the consistency of the finished product pellet size and adjust subsequent processes.
[0003] Current production sites typically use timed sampling, sieving, weighing, and manual visual inspection to detect fish feed damage. These methods rely on offline sampling, resulting in a time lag between the inspection results and the continuous production process, and making it difficult to consistently pinpoint the time period in which damage occurred. Online machine vision inspection uses cameras to acquire images of the conveyor belt. A common approach is to distinguish the fish feed from the image background, and then determine whether damage has occurred based on the area, aspect ratio, roundness, or outline integrity of individual image regions.
[0004] In a cooling and conveying scenario, multiple fish feed fragments formed after the same fish feed pellet breaks will appear separated in the image. Larger fish feed fragments may appear close to shorter, intact fish feed pellets when viewed individually; simultaneously, adjacent intact fish feed pellets may also briefly move closer together due to feeding and conveying. Classifying each image region individually makes it difficult to confirm whether multiple image regions correspond to the same breakage process.
[0005] If image regions are merged solely based on frame spacing or contour similarity, the overall movement of the conveyor belt, changes in the posture of fish feed particles, local occlusion, and proximity of adjacent fish feed particles can all affect the judgment. This can lead to situations where the same breakage event is split and counted separately, or different fish feed particles are counted together. Therefore, online detection of cooled fish feed still needs to address how to determine whether multiple separate image regions in continuous conveying images have a pre-breakage continuity relationship, and how to group image regions belonging to the same breakage process into the same cooled fish feed breakage event. Summary of the Invention
[0006] This invention provides a machine vision-based method for identifying fish feed damage after cooling, which solves the technical problems mentioned in the background art.
[0007] To achieve the above-mentioned objectives, the present invention provides the following technical solution.
[0008] A machine vision-based method for identifying fish feed breakage after cooling includes: Continuous images of the cooled fish feed during the transportation process are acquired, and the fish feed particles and fish feed fragments in the continuous images are regionalized to obtain multiple image regions. For each image region, two end nodes with end directions are determined, and the end position, end direction, end proximity width, and end contour of each end node are extracted. Between relative end nodes belonging to different image regions, the facing relationship between ends is determined based on end position and end direction, the continuity of lateral width is determined based on the adjacent width of the ends and the lateral dimension reference of the fish feed, the reverse complementary relationship of end contours is determined based on the reverse fit of end contours, and the cross-frame relative position relationship is determined based on the cross-frame relative position change after conveying motion compensation. When the end-facing relationship, the horizontal width continuity relationship, the end contour reverse complementary relationship and the cross-frame relative position relationship are all established, it is determined that the two image regions have a continuity relationship before the break, and the relationship between the two image regions is used as the continuation edge to construct the break-end continuation diagram. The connected components in the broken-end continuation graph that are connected by continuation edges and contain at least two nodes are identified as fish feed breakage events after cooling and output.
[0009] Compared with the prior art, the present invention has the following substantial features and significant progress: Compared to existing methods that primarily rely on the area, aspect ratio, or roundness of individual image regions to determine fish feed breakage, this invention addresses the continuous conveying process of cooled fish feed. It acquires continuous images and forms image regions corresponding to fish feed particles and fragments. By considering end position, end direction, adjacent width, and end contour, combined with conveying motion compensation, it jointly determines end-to-end orientation, lateral width continuity, reverse complementary end contour, and cross-frame relative positional relationships. Based on this, it establishes continuation edges and constructs a breakage continuation map. Connected components linked by these edges and containing at least two nodes are output as cooled fish feed breakage events. This process utilizes information reflected by end contour reverse complementary relationships, lateral width continuity, and cross-frame relative positional relationships to reduce interference from image regions that are close to each other but do not belong to the same breakage process on event merging. It also merges separate image regions with pre-breakage continuity relationships according to events, providing identification results for post-cooling breakage statistics, grading and screening, or pre-packaging quality control. Attached Figure Description
[0010] Figure 1 This is a diagram of the machine vision-based fish feed cooling damage identification module of the present invention. Figure 2 This is a flowchart of the machine vision-based method for identifying fish feed damage after cooling, according to the present invention. Detailed Implementation
[0011] The following description is provided in conjunction with the accompanying drawings. It should be understood that the following embodiments are for illustrative purposes only and are not intended to limit the invention; those skilled in the art can make equivalent substitutions or combinations for the specific implementations.
[0012] The following combination Figure 1 and Figure 2 This invention describes specific embodiments. After pelleting, drying, and cooling, fish feed is conveyed by a conveyor belt to a grading and screening station or a packaging station. During discharge and transfer, when subjected to collisions or compression, the same fish feed pellet may break into separate fish feed fragments. Shorter, intact fish feed pellets and fish feed fragments easily overlap in terms of individual characteristics such as area and aspect ratio. Adjacent fish feed pellets from different sources may also appear close together in a single frame image. This embodiment determines the continuity before breakage from the end geometry, lateral dimension, end contour, and continuous frame position relationships between multiple image regions, and outputs the fish feed breakage event after cooling accordingly.
[0013] See Figure 1 and Figure 2 The continuous image acquisition module 111 acquires continuous images of the cooled fish feed during the transport process. The regionalization module 112 distinguishes the cooled fish feed from the image background in the continuous images and identifies the separated fish feed particles and fragments as image regions. The end node determination module 113 and the end extraction module 114 obtain the end nodes, end positions, end directions, end proximity widths, and end contours of each image region. The transport motion compensation module 115 uses the overall motion of the transport background as a reference to transform the positions of image regions in different frames to the same transport coordinate reference. The relationship determination module 116 determines the end facing relationship, lateral width continuity relationship, end contour reverse complementary relationship, and cross-frame relative position relationship between relative end nodes; when all four relationships are true, a continuation edge is formed. The end continuation graph construction module 117 constructs an end continuation graph using image regions as nodes and continuation edges as edges. The cooled fish feed breakage event output module 118 identifies and outputs the connected components connected by continuation edges and containing at least two nodes as cooled fish feed breakage events. Figure 2 S211 to S219 in the above process sequence correspond to the above processing sequence.
[0014] A continuous image acquisition module 111 is installed in the conveyor section between the discharge end of the cooling equipment and the subsequent grading and screening station or packaging station. An industrial camera is mounted above the conveyor belt's bearing surface, with a working distance of [missing information]. Lens focal length The angle between the optical axis of the industrial camera and the normal to the conveyor belt bearing surface is controlled within... Within a certain range. Adjust the installation direction of the industrial camera around the optical axis so that the horizontal axis of the image coordinates is parallel to the conveyor direction and the vertical axis is perpendicular to the conveyor direction. The industrial camera's field of view covers the area of the conveyor belt through which the cooled fish feed passes, while retaining a conveyor background at the edge of the field of view that reveals the surface texture of the conveyor belt. Strip diffuse light sources are positioned on both sides of the field of view, maintaining the illuminance of the conveyor belt's supporting surface at a certain level. to Industrial cameras, lenses, and light sources are fixed and continuously captured, ensuring that each frame has the same imaging geometry and brightness relationship.
[0015] Before continuous image acquisition, a planar calibration plate is placed on the plane of the conveyor belt's bearing surface. Lens distortion correction and pixel scale calibration are performed using markers with known spacing on the planar calibration plate. After calibration, each frame of image undergoes lens distortion correction before localization. The pixel scale remains consistent under the same industrial camera installation position, lens parameters, and image resolution. End position, adjacent width, end spacing, lateral misalignment, and inter-frame relative displacement residuals are all obtained at this pixel scale.
[0016] The lateral dimension benchmark for fish feed is determined by fish feed particles of the same specification within the same industrial camera's field of view. Selecting intact fish feed particles, first determine the measurement direction perpendicular to the longitudinal direction based on the longitudinal direction of the image area corresponding to each particle, then measure the minor axis pixel width along this measurement direction. Arrange all minor axis pixel widths from smallest to largest, and take the median as the lateral dimension benchmark for the fish feed. Subsequent determinations involving distance and width proportions all use the same lateral dimension benchmark for the fish feed.
[0017] The continuous image acquisition module 111 acquires RGB images at a fixed frame rate and records each frame in the acquisition order. A single relationship verification uses a short-time window composed of adjacent frames, with the number of frames in the short-time window equal to the number of consecutive frames. The short-time window is updated sequentially in one-frame increments. Each short-time window uses the first frame as the current frame and establishes a break-end continuation map; the remaining frames provide the timing data required for motion compensation and cross-frame relative position changes.
[0018] The regionalization module 112 processes continuous images frame by frame. After converting the RGB image to grayscale, it uses... Median filtering windows are used to remove isolated noise; contrast-limited adaptive histogram equalization is employed to handle slowly varying illumination unevenness, with block sizes set to... Pixel, contrast limit value The preprocessed grayscale image was used to distinguish the cooled fish feed from the image background using the OTSU threshold. The resulting foreground binary image was then processed sequentially using... The elliptical structuring element of a pixel performs one opening operation and one closing operation.
[0019] For fish feed pellets or fragments in contact with each other in the foreground binary map, the localization module 112 calculates the Euclidean distance transformation. Within each foreground region, local maxima are searched in descending order of distance transformation values, ensuring that the distance transformation value of a local maxima is at least equal to the maximum distance transformation value of that foreground region. The distance between adjacent local maxima is at least one times the lateral dimension of the fish feed. The local maxima that meet the conditions are marked internally. The negative of the distance transformation result is used as the watershed for marking, separating the contacting objects. After regionalization, each separated fish feed particle and fish feed fragment forms an image region, and the frame, foreground pixel set, outer boundary, and geometric center are saved.
[0020] The outer boundary of the image region is obtained using eight-neighbor boundary tracking. Boundary tracking starts from the boundary pixel with the smallest ordinate and abscissa in the foreground pixel set, and records the foreground pixels adjacent to the image background in a clockwise direction until returning to the starting boundary pixel. Boundaries generated by internal holes are not included in the end-point extraction. The geometric center is obtained by taking the arithmetic mean of the abscissa and ordinate of all pixels in the foreground pixel set. The regionalization module 112 performs the same processing in each frame of the continuous image, thereby ensuring that the vertical direction, end-point position, and end-point contour are all based on the same type of discrete boundary data.
[0021] The end node determination module 113 determines the longitudinal direction based on the outer boundary of the image region. It calculates the Euclidean distance between each pair of boundary points within the outer boundary and determines the direction of the straight line formed by the boundary point pair with the largest Euclidean distance as the longitudinal direction. For each boundary point pair, the two boundary points are first arranged in ascending order of their x-coordinates; if the x-coordinates are the same, they are arranged in ascending order of their y-coordinates. If multiple boundary point pairs have the same Euclidean distance, they are then arranged in ascending order of the x-coordinates and y-coordinates of the first and second boundary points, and the first boundary point pair is selected. The longitudinal direction represents an axis without positive or negative sign. Foreground pixels are projected along the longitudinal direction, forming end nodes at the ends with the smallest and largest projection values, respectively. For each end node, the sign of the longitudinal direction is adjusted so that it points from the geometric center of the image region to that end, thus obtaining the end direction. The two end directions of an image region are opposite along the longitudinal direction.
[0022] The end position is determined by the corresponding outer boundary point. Using the geometric center of the image region as the projection starting point, project the outer boundary point along the end direction to obtain the maximum projection value for that end; ensure the difference between the projected value and the maximum projection value does not exceed [a certain value]. All outer boundary points of each pixel are used as the end position point set. The arithmetic mean of the x and y coordinates of the end position point set is calculated, and the resulting two-dimensional coordinates are the end positions. The end with the smallest projection value is processed in the opposite end direction. The end position point set, projection range, and center determination method are kept consistent throughout the entire image region.
[0023] Once the end position is determined, the end node stores the image region identifier, end position, and end orientation. The x and y coordinates of the end position are saved to [the specified location]. Each pixel is used to ensure consistent precision for subsequent rotation, projection, and transport motion compensation. The end direction is represented by a unit vector and stored according to the horizontal and vertical components of the image coordinates. Two end nodes belonging to the same image region are associated with their respective end positions, and the relationship determination module 116 enumerates combinations of end nodes belonging to different image regions accordingly.
[0024] The end extraction module 114 establishes local coordinates for the end with the end position as the origin. The positive axial direction of the local coordinates is consistent with the end direction, and the positive lateral direction is rotated counterclockwise from the positive axial direction. The depth is obtained. The end-adjacent region extends from the end position into the image region, and the end truncation depth is defined by the boundary between the two sidewalls of the image region and the outer boundary of the end. After saving the end contour according to the local coordinates of the end, the end direction of different image regions all correspond to the same positive axial direction.
[0025] The end-adjacent width is obtained inside the end position. The end measurement distance is moved inward from the end position along the opposite direction of the end direction, and a measurement line segment perpendicular to the longitudinal direction is set at the obtained position. The intersection of the measurement line segment and the closed foreground region of the image area is projected onto the measurement line segment. The positions with the minimum and maximum projected coordinates are taken as the two intersection points between the measurement line segment and the outer boundaries of both sides of the image area. The pixel distance between the two intersection points is taken as the end-adjacent width. The lateral sampling range of the end contour uses the lateral coordinate range corresponding to the two intersection points of the same measurement line segment, ensuring that the end-adjacent width and the end contour cover the same lateral range of the main body.
[0026] The end profile is represented by several equally spaced lateral sampling positions of the end sampling points, with both endpoints of the lateral sampling range included in the sampling. Adjacent outer boundary points obtained from eight-neighbor boundary tracking are sequentially connected by straight line segments to form a closed outer boundary polyline. For each lateral sampling position, a sampling line parallel to the axis of the end's local coordinates is set in the adjacent region of the end. The intersection point with the outer boundary polyline, where the axial coordinate is largest, is selected and recorded as a value in the end offset sequence. All lateral sampling positions use the same method for finding intersections with the outer boundary polyline. The average end offset is the arithmetic mean of all values in the end offset sequence.
[0027] When comparing two end profiles, each end profile is first mapped to the same sampling number from the left boundary to the right boundary according to its adjacent width. The first sampling position corresponds to the outer boundary on the negative lateral direction of the end's local coordinates, the last sampling position corresponds to the outer boundary on the positive lateral direction, and the intermediate sampling positions are arranged at equal lateral intervals. This organization method allows two end profiles with slightly different widths to be compared at the same lateral proportion, while preserving the original axial concavity and convexity variations of each end profile.
[0028] The end undulation amount was obtained using a uniform standard. First, the average end offset was subtracted from each value in the end offset sequence. Then, the difference between the maximum and minimum values in the resulting sequence was taken. Finally, it was normalized using the lateral dimension of the fish feed as a reference to obtain the dimensionless end undulation amount. End nodes whose end undulation amount reached the lower limit of end undulation were designated as candidate end nodes for breakage.
[0029] The conveying motion compensation module 115 uses normalized cross-correlation template matching to measure the overall motion of the conveying background. Two fixed conveying background regions are set at the midpoint of the field of view along the conveying direction, with the centers of the two regions located at one-quarter and three-quarters of the lateral width of the field of view, respectively. Within each conveying background region, [the following parameters are selected]. A template containing pixels and the surface texture of the conveyor belt. The search range of the next frame covers both sides of the template along the conveyor direction. Each pixel, covering both sides of the horizontal template Each pixel is used as the matching position. The maximum position of the normalized cross-correlation result is used as the matching position, and a one-dimensional quadratic curve is fitted to the maximum position and the two results adjacent to it along the conveying direction to obtain the sub-pixel matching position. The difference between the matching position and the template position of each conveying background area forms a two-dimensional displacement. The arithmetic mean of the horizontal and vertical components of the two two-dimensional displacements is taken as the arithmetic mean of the belt displacement of each adjacent frame.
[0030] The first frame of the short-time window is used as the transport coordinate reference. For each subsequent frame, the belt displacement from the first frame to that frame is accumulated frame by frame, and the accumulated result is subtracted from the image region position and end position of that frame, thereby transforming the image region positions in different frames to the same transport coordinate reference. This translation process preserves the end direction, end proximity width, and end profile.
[0031] Under the same transport coordinate reference, short-time correspondences of image regions are established according to adjacent frames. First, the geometric center distance between each image region in the previous frame and each image region in the next frame is calculated. Then, candidates whose distance does not exceed the upper limit of the short-time correspondence distance are arranged in ascending order of distance. When selecting candidates sequentially, a short-time correspondence is formed only when no correspondence is established between two image regions, thus obtaining a one-to-one correspondence result. When the distances are the same, the abscissa of the geometric center of the image region in the next frame is compared first, then the ordinate, with the candidate with the smaller value ranked first. Only image regions where a one-to-one correspondence is formed between adjacent frames within the short-time window are used as the objects for calculating cross-frame relative positional relationships. Short-time correspondences link the same actual object in consecutive frames, allowing for comparison of cross-frame relative positional changes.
[0032] The relationship determination module 116 establishes relative end node candidates between end nodes belonging to different image regions in the current frame. First, it calculates the minimum outer boundary distance between two end contours and uses it as the end spacing. When the end spacing does not exceed the product of the fish feed lateral dimension reference and the candidate spacing multiple, it determines the end orientation relationship based on the two end positions and two end directions. After the end orientation relationship is established, it uses the end direction of the first end node and the opposite direction of the end direction of the second end node. It adds the unit vectors of these two directions and normalizes them; the resulting direction is used as the candidate continuation direction for the relative end node candidate. The candidate continuation direction is then rotated counterclockwise. The candidate lateral direction is obtained. The absolute value of the projection length of the end connection line in the candidate lateral direction is the lateral misalignment. If the lateral misalignment does not exceed the product of the fish feed lateral dimension reference and the lateral misalignment multiple, the candidate relative end node is retained.
[0033] Candidate relative end nodes are processed in ascending order of end spacing. Each candidate group retains the image region identifiers, end positions, end directions, adjacent widths, end contours, and short-time correspondences of the two end nodes. End orientation relationships, horizontal width continuity relationships, and reverse complementary end contour relationships use the end data of the current frame, while cross-frame relative position relationships use the image region positions of the frames connected by the short-time correspondences. All four relationships are triggered by the same group of image regions and the same group of relative end nodes, avoiding the merging of judgment results from different candidates.
[0034] The end-to-end orientation relationship is determined based on the end positions and end directions. The two end positions form an end-to-end line. The direction from the first end position to the second end position and the direction from the second end position to the first end position are respectively taken as the direction of the corresponding end-to-end line. The angle between each end direction and the corresponding end-to-end line direction is measured. The end-to-end orientation relationship is established when both angles do not exceed the upper limit of the end-to-end orientation angle.
[0035] The horizontal width continuity is determined based on the adjacent widths of two opposite end nodes and the horizontal dimension reference of the fish feed. The absolute value of the difference between the two adjacent widths is taken and normalized using the larger adjacent width; the resulting difference ratio does not exceed the upper limit of the width difference. Then, the arithmetic mean of the two adjacent widths is taken, and the absolute value of the difference between this arithmetic mean and the horizontal dimension reference of the fish feed is calculated and normalized using the horizontal dimension reference of the fish feed; the resulting deviation ratio does not exceed the upper limit of the average width deviation. When both conditions are met, the two image regions belong to the continuous portion of fish feed of the same specification in terms of horizontal dimension, and the horizontal width continuity is established.
[0036] The complementary relationship between the end contours is compared based on the local coordinates of the ends. Both end contours are aligned to the same comparison direction, using a positive axial direction pointing from the image region towards the end, and a positive lateral direction rotating counter-clockwise from the positive axial direction. The local coordinates of the ends are calculated. The average end offset is subtracted from each of the two end offset sequences. The lateral sampling order of the sequence obtained for the second end node is reversed, and the inverse value of each value is taken to complete the reverse correspondence. At this point, the concavity of the second end contour has the same sign and the same lateral sampling position as the convexity of the first end contour.
[0037] The end-fitting error is determined by comparing the sequence obtained after reverse correspondence with the sequence obtained from the first end node item by item. For two values at the same lateral sampling position, the absolute value of the difference is taken, and the arithmetic mean of all absolute values is calculated. This result is then normalized using the lateral dimension of the fish feed as a reference. The resulting dimensionless result is the end-fitting error. When the end undulations of both end nodes reach the lower limit of end undulation and the end-fitting error does not exceed the upper limit of end-fitting, the concave-convex fit relationship after reverse correspondence is confirmed, and the reverse complementary relationship of the end contours is established.
[0038] The cross-frame relative positional relationship is determined using the two-dimensional positional difference between the geometric centers of the image regions. For two image regions that have established a short-term correspondence, in each frame of the short-term window, the two-dimensional positional difference vector obtained by pointing the geometric center of the first image region under the transport coordinate reference to the geometric center of the second image region under the transport coordinate reference is taken as the relative position of that frame. Taking the relative position of the first frame of the short-term window as the comparison starting point, the vector difference between the relative position of each subsequent frame and the comparison starting point is calculated, and the Euclidean length of the vector difference is taken as the cross-frame relative positional change of that frame. The maximum value among all subsequent frames' cross-frame relative positional changes is the inter-frame relative displacement residual. The product of the fish feed lateral dimension reference and the time residual multiple is the time tolerance; when the inter-frame relative displacement residual does not exceed the time tolerance, the relative positional relationship is maintained, and the cross-frame relative positional relationship is determined to be valid.
[0039] The relationship determination module 116 stores the judgment results of four relationships for each group of relative end nodes. When the end-facing relationship, the horizontal width continuity relationship, the end contour reverse complementarity relationship, and the cross-frame relative position relationship are all true, it is determined that the two image regions have a pre-break continuity relationship. When there are multiple candidates that meet the conditions for the same end node, they are first arranged in ascending order of end-break fitting error; when the end-break fitting errors are the same, they are arranged in ascending order of end-end spacing; when the end-end spacing is still the same, they are arranged in ascending order of the image region identifier to which the other end node belongs; when the image region identifiers are still the same, they are arranged in ascending order of the horizontal and vertical coordinates of the end position of the other end node. Each end node takes the first candidate in the ranking, and the two end nodes are required to mutually use each other as the first candidate in the ranking; after satisfying this pairing relationship, a continuation edge is formed between the two image regions. One end node forms one continuation edge, and two end nodes in the same image region can form continuation edges with different image regions respectively.
[0040] The break-end continuation graph construction module 117 constructs a break-end continuation graph using the image regions that have completed the judgment in the current frame of the short-term window as nodes and the continuation edges as edges. Each image region in the current frame corresponds to a node in the break-end continuation graph, and the continuation edge records the two image regions it connects. The remaining frames in the short-term window provide verification data for the relative positional relationships across frames.
[0041] The cooled fish feed breakage event output module 118 performs connected component traversal on the broken-end continuation graph. Starting from a node connected to the continuation edge that has not yet been traversed, it visits all reachable nodes along the continuation edge to obtain a connected component. A connected component connected by a continuation edge and containing at least two nodes corresponds to a cooled fish feed breakage event. All image regions within the same connected component belong to the same cooled fish feed breakage event; different connected components are output as different cooled fish feed breakage events.
[0042] Each judgment parameter was obtained through offline calibration. Calibration data includes... Group of artificially confirmed homologous fish feed fragment combinations and A group of manually confirmed non-homologous combinations; non-homologous combinations are formed by Group of adjacent whole fish feed pellets and The groups consist of fish feed pellets or fish feed fragments from different sources. Various combinations cover the conveying direction at intervals... The attitude obtained from the degree of approach, the end-to-end distance from the nearest candidate distance multiple to the upper limit, and the left, middle, and right positions of the field of view. Each type of data is categorized by... and The system is hierarchically divided into a calibration set and a validation set, so that the calibration set contains... Groups and validation sets contain Group, and keep the number of homologous combinations and non-homologous combinations the same.
[0043] During calibration, the lateral dimension benchmark of the fish feed was first determined using whole fish feed pellets of the same specification. For each group of fish feed fragments from the same source in the calibration set, the ratio of the end spacing to the lateral dimension benchmark, the ratio of the lateral misalignment to the lateral dimension benchmark, and the larger angle between the directions of the two ends and the lines connecting their respective ends were obtained. Duplicate values were removed from all measurement results, and the results were arranged in ascending order, selecting those that ensured at least [number missing] values in the calibration set. The minimum values of four relation judgments were used to determine the candidate spacing multiple, lateral misalignment multiple, and upper limit of the end-to-end facing angle for homologous fish feed fragment combinations and non-homologous fish feed fragment combinations in the calibration set. Subsequently, end undulation, end-to-end fitting error, difference ratio, deviation ratio, and the ratio of inter-frame relative displacement residual to the fish feed lateral dimension baseline were obtained for homologous and non-homologous fish feed fragment combinations in the calibration set. These five categories of values were then removed of duplicates and arranged in ascending order to form discrete candidate values for the lower limit of end undulation, upper limit of end-to-end fitting, upper limit of width difference, upper limit of average width deviation, and time residual multiple. Four relation judgments were performed on all discrete candidate value combinations, selecting the combination with the highest F1 score; if F1 scores were the same, the combination with fewer misclassified non-homologous combinations was selected; if the number of misclassified non-homologous combinations was still the same, the combination with the larger lower limit of end undulation, smaller upper limit of end-to-end fitting, smaller upper limit of width difference, smaller upper limit of average width deviation, and smaller time residual multiple was selected in that order. The final parameter combination achieved high precision and recall on the validation set. The calibration was completed in time.
[0044] Each data set in the validation set is evaluated only once, and the output continuity relationship before the break is compared with the manually confirmed results for each set. Combinations of homologous fish feed fragments that are correctly linked are recorded as correctly identified; combinations of non-homologous fragments that are not linked are recorded as correctly excluded. After the parameters are determined, continuous data collection continues. A short-time window is used for verification, checking the number of image regions obtained from regionalization, end positions, end proximity widths, end contours, and short-time correspondences frame by frame. The verification data uses the processing parameters fixed during calibration to confirm that the complete processing chain can repeatedly obtain the same judgment criteria in consecutive images.
[0045] Example 1: In this embodiment, an industrial camera is installed on the conveyor belt after the discharge end of the fish feed cooling equipment. The industrial camera acquires data at a resolution of [resolution missing]. RGB image, frame rate Exposure time is The length of the field of view along the conveying direction is... The horizontal width of the field of view is After lens distortion correction is completed, each pixel corresponds to The conveyor belt speed is The background in adjacent frames moves approximately along the transport direction. Each pixel. The number of consecutive frames is taken as... The short window is the first Frame, First Frame and the Frame composition.
[0046] Measurement within the same field of view Each fish feed pellet is identical in appearance and size, with its short axis pixel width distributed within... 1 pixel to pixels, median is Each pixel, the horizontal dimension of the fish feed is taken as the reference. Each pixel. The number of end sampling points is taken as... The end cutting depth is taken from the lateral dimension of the fish feed. The distance of the end measurement shifted inward is taken as the reference for the lateral dimension of the fish feed. The upper limit of the end-to-end facing angle is taken as [times]. Degree, candidate spacing multiple Horizontal misalignment multiple The upper limit of the width difference is taken The upper limit of the average width deviation is taken as The lower limit of end undulation is taken as... The upper limit of the joint of the broken ends is taken Time residual multiple The upper limit of the short-term corresponding distance is taken from the lateral dimension of the fish feed. The time tolerance is times the number of times. 1 pixel.
[0047] No. The frame is regionalized to obtain image regions A, B, C, and D. Image regions A, B, and C, in manual annotation, belong to three fish feed fragments formed from the breakage of the same fish feed particle, while image region D represents another adjacent fish feed particle. The end node determination module 113 determines the longitudinal direction and end nodes of the four image regions. The end node of image region A towards image region B is denoted as end node A1, the end node of image region B towards image region A is denoted as end node B1, the end node of image region B towards image region C is denoted as end node B2, the end node of image region C towards image region B is denoted as end node C1, and the end node of image region D towards image region C is denoted as end node D1.
[0048] The regionalization in this embodiment adopts Pixel median filter window Pixel block size and The contrast limit value. After OTSU thresholding, the following is used: Each pixel-elliptical structuring element undergoes an opening and closing operation once, and then the contact objects are separated based on the Euclidean distance transformation and the marked watershed. In the frame, the maximum projection value of the outer boundary point corresponding to end node A1 along the end direction is 1 pixel, the projected value is located at 1 pixel. 1 pixel to Within a pixel range The set of endpoint locations is composed of several outer boundary points. The arithmetic mean of the x-coordinates of this set of endpoint locations is... pixels, the arithmetic mean of the ordinate is . Pixels, the end position of end node A1 is .
[0049] The end spacing between end node A1 and end node B1 is The absolute value of the projection length of the end connection line in the candidate lateral direction is 1 pixel. pixels; the end spacing between end node B2 and end node C1 is . The absolute value of the projection length of the end connection line in the candidate lateral direction is 1 pixel. Each pixel. End spacing is less than [number] pixels. The candidate range of pixels has a lateral misalignment of less than [number] pixels. Within the allowed range of pixels, both sets of end nodes are considered as candidates for relative end nodes.
[0050] The angle between the end direction of end node A1 and the line connecting the end nodes pointing to end node B1 is... The angle between the end direction of end node B1 and the line connecting the end points to end node A1 is degrees. degrees; the two included angles corresponding to end nodes B2 and C1 are respectively Degree and Degrees. None of the four included angles exceed the upper limit of the angle between the ends. The degree is such that the end-to-end relationship between the two sets of opposite end nodes is established.
[0051] The widths of the adjacent nodes at end nodes A1 and B1 are respectively 1 pixel and The difference between the two pixels is a proportion of the width of the larger end's adjacent width. The arithmetic mean of the two is Each pixel deviates from the horizontal dimension reference of the fish feed by a ratio of [number] pixels. The end neighbor widths of end nodes B2 and C1 are respectively... 1 pixel and The difference between the two is pixels, and the ratio is . The arithmetic mean of the two is Each pixel deviates from the horizontal dimension reference of the fish feed by a ratio of [number] pixels. Both sets of results satisfy the upper limit of the width difference. and the upper limit of average width deviation The horizontal width continuity relationship holds true.
[0052] Taking end nodes A1 and B1 as examples, the end offset sequences after subtracting their respective average end offsets are as follows: and The unit is pixels. The difference between the maximum and minimum values of the first sequence is... The end undulation of end node A1 is [number] pixels, normalized to the lateral dimension of the fish feed. The difference between the maximum and minimum values of the second sequence is The number of pixels, and the end undulation of end node B1 is . Both end-point undulations reached the lower limit of end-point undulation. .
[0053] Reverse the lateral sampling order of the end offset sequence of end node B1 and take the opposite number of each item to obtain The absolute values of the differences between this sequence and the end offset sequence of end node A1 at the eight lateral sampling positions are all... pixels, with an arithmetic mean of . Each pixel, after normalization based on the lateral dimension of the fish feed, has a break-end fitting error of [number] pixels. The fitting error of the broken ends shall not exceed the upper limit of the fitting error of the broken ends. The inverse complementary relationship between the end profiles of end nodes A1 and B1 holds. Following the same process, the end undulations of end nodes B2 and C1 are respectively... and The fit error of the broken ends is The reverse complementary relationship of the end contours holds true.
[0054] The motion compensation module 115 is in the first stage Frame and the The displacement of the belt per frame was measured between frames. The pixel, at the Frame and the The displacement of the belt per frame was measured between frames. The number of pixels is represented by two components: the horizontal coordinate component and the vertical coordinate component. From the first pixel... Frame to the The displacement of the belt is accumulated frame by frame, and the resulting two-dimensional displacement is: Each pixel. Before motion compensation, the geometric centers of image region A in the three frames are, respectively: , and Image region B is as follows: , and Image regions C are as follows: , and From the first Frame and the After subtracting the two-dimensional displacement obtained by summing the belt displacement frame by frame from the geometric center of the frame, the geometric center of image region A in the three frames is as follows: , and Image region B is as follows: , and Image regions C are as follows: , and The coordinate unit is pixels. Each image region satisfies the following condition between adjacent frames within a short time window: The upper limit of the short-time correspondence distance of each pixel is used to establish the short-time correspondence.
[0055] The relative positions of the three frames pointing from image region A to image region B are as follows: , and The Euclidean lengths of the vector differences between the relative positions of the last two frames and the relative positions of the first frame are approximately... 1 pixel and The relative displacement residual between frames is pixels. Each pixel. The relative positions of the three frames pointing from image region B to image region C are as follows: , and The corresponding cross-frame relative position changes are approximately 1 pixel and The relative displacement residual between frames is pixels. Each pixel. The relative displacement residuals between the two frames do not exceed the time tolerance. Each pixel represents a relative positional relationship between two sets of image regions, and this relative positional relationship holds true across frames.
[0056] The relationship determination module 116 determines that the two sets of image regions have a continuity relationship before the break, and forms a continuation edge connecting image region A and image region B, and a continuation edge connecting image region B and image region C.
[0057] The end spacing between end node C2 and end node D1 is Each pixel corresponds to an angle between the two end directions and the line connecting the ends, which is... Degree and The degrees and the adjacent widths at the ends are respectively 1 pixel and Each pixel ensures that the end-to-end facing relationship and the horizontal width continuity are met. The end-to-end fitting error after completing the reverse mapping of the end contours is... The inter-frame relative displacement residual after completing the transmission motion compensation is One pixel. The end-fitting error exceeds the end-fitting limit. The inter-frame relative displacement residual exceeds the time tolerance. If the four relationships do not hold simultaneously, no continuation edge is formed between image region C and image region D.
[0058] The discontinuity continuation graph construction module 117 constructs a discontinuity continuation graph using image regions A, B, C, and D as nodes and two continuation edges as edges. It traverses along the continuation edges to obtain connected components containing image regions A, B, and C. The cooled fish feed breakage event output module 118 assigns all image regions within this connected component to the same cooled fish feed breakage event and outputs it. Image region D is not connected to this connected component via a continuation edge. If other connected components connected by continuation edges and containing at least two nodes exist within the same short-term window, each connected component is output as a different cooled fish feed breakage event.
[0059] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and all such modifications and variations fall within the scope defined by the appended claims.
Claims
1. A machine vision-based method for identifying fish feed breakage after cooling, characterized in that, include: Continuous images of the cooled fish feed during the transportation process are acquired, and the fish feed particles and fish feed fragments in the continuous images are regionalized to obtain multiple image regions. For each image region, two end nodes with end directions are determined, and the end position, end direction, end proximity width, and end contour of each end node are extracted. Between relative end nodes belonging to different image regions, the facing relationship between ends is determined based on end position and end direction, the continuity of lateral width is determined based on the adjacent width of the ends and the lateral dimension reference of the fish feed, the reverse complementary relationship of end contours is determined based on the reverse fit of end contours, and the cross-frame relative position relationship is determined based on the cross-frame relative position change after conveying motion compensation. When the end-facing relationship, the horizontal width continuity relationship, the end contour reverse complementary relationship and the cross-frame relative position relationship are all established, it is determined that the two image regions have a continuity relationship before the break, and the relationship between the two image regions is used as the continuation edge to construct the break-end continuation diagram. The connected components in the broken-end continuation graph that are connected by continuation edges and contain at least two nodes are identified as fish feed breakage events after cooling and output.
2. The method for identifying fish feed breakage after cooling based on machine vision according to claim 1, characterized in that, The regionalization includes distinguishing cooled fish feed from the image background from the continuous images, and identifying mutually separated fish feed particles and fish feed fragments as the image regions.
3. The method for identifying fish feed breakage after cooling based on machine vision according to claim 1, characterized in that, Determining the end nodes includes determining the longitudinal direction of each image region and forming end nodes at both ends of the longitudinal direction, such that each end node has an end direction pointing from the inside of the image region to the end.
4. The method for identifying fish feed breakage after cooling based on machine vision according to claim 1, characterized in that, The end-to-end relationship includes determining the end connection line based on the end positions of the two opposite end nodes, and determining the state of the end directions of the two opposite end nodes pointing to the end connection line respectively.
5. The method for identifying fish feed breakage after cooling based on machine vision according to claim 1, characterized in that, The horizontal width continuity relationship includes comparing the adjacent widths of the ends of two opposite end nodes with the horizontal dimension reference of the fish feed as the comparison reference, and is used to determine that the two image regions belong to the continuous part of the same specification of fish feed in terms of horizontal dimension.
6. The method for identifying fish feed breakage after cooling based on machine vision according to claim 1, characterized in that, The reverse complementary relationship of the end contours includes unifying the end contours of two opposite end nodes to the same comparison direction and then performing reverse correspondence, and determining it based on the concave-convex fit relationship after reverse correspondence.
7. The method for identifying fish feed breakage after cooling based on machine vision according to claim 1, characterized in that, The transport motion compensation includes transforming the image region positions in different frames to the same transport coordinate reference, based on the overall motion of the transport background in the continuous images.
8. The method for identifying fish feed breakage after cooling based on machine vision according to claim 1, characterized in that, The cross-frame relative position relationship includes comparing the relative position changes between two image regions in different frames after the transport motion compensation is completed, and determining the relative position maintenance relationship between the two image regions after the transport motion compensation is completed based on the relative position changes.
9. The method for identifying fish feed breakage after cooling based on machine vision according to claim 1, characterized in that, The output of the cooled fish feed damage event includes classifying all image regions within the same connected component as the same cooled fish feed damage event, and outputting different connected components as different cooled fish feed damage events.
