A fish information recognition and biomass estimation method based on binocular images
By using a binocular image-based method for fish information recognition and biomass estimation, the problems of anti-background interference and interpretability in estimating fish size and biomass in underwater environments are solved, and stable and accurate measurements of fish length, width and weight are achieved.
Patent Information
- Application Number
- CN202611663789.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-27
- Publication Date
- 2026-11-27
AI Technical Summary
In fish biomass estimation, the resistance to background interference and interpretability of fish-by-fish biomass estimation in existing technologies need to be improved. In particular, when there are interference factors such as suspended objects, reflections, partial occlusion and background textures in underwater images, the stereo matching results are prone to depth holes, depth jumps or background depth mixing, which affects the accuracy of fish size and biomass estimation.
A method for fish information recognition and biomass estimation based on binocular images is adopted. Fish body masks are generated by fish body target detection and target association. The fish species and head orientation are determined by combining visual semantic recognition. Morphological operations are performed to select the endpoints of the fish body contour. Stereo matching is performed and foreground parallax modal with spatial support is selected. The length, width and weight of the fish body are calculated.
It improves the resistance to background interference in fish biomass estimation, enhances the stability and accuracy of the measurement, reduces the influence of background depth and local noise, and improves the interpretability of fish size and weight estimation.
Smart Images

Figure CN123182006A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of fish information recognition and biomass estimation technology, and in particular to a method for fish information recognition and biomass estimation based on binocular images. Background Technology
[0002] Fish species, size, and biomass are crucial foundational information for aquaculture management, feed administration, and yield assessment. Existing methods of manual harvesting, measurement, and weighing require significant manpower and disturb the fish, making them unsuitable for continuous, fish-by-fish management. Non-contact measurement using binocular images can recover target distances based on parallax information between the left and right views, providing a data foundation for estimating fish size and biomass. However, underwater images often contain interference factors such as suspended matter, reflections, partial occlusion, and background textures. Stereo matching results can easily exhibit depth holes, depth jumps, or background depth intrusion near the fish's outline and endpoints. Directly using the depth at the measured endpoint for conversion results can lead to errors in two-dimensional endpoint positioning and local depth, both affecting the estimated length, width, and weight. Furthermore, fish species, head orientation, and the measured endpoint are different types of information. Using classification results directly to determine the measurement endpoint makes it difficult to guarantee consistency in endpoint definition and geometric scale.
[0003] In the prior art, Chinese patent CN119271987A discloses a method and system for estimating fish biomass based on a deep learning multimodal fusion model. The method includes: acquiring images, audio, and water quality data, as well as feed amount data, within each feeding period; inputting the preprocessed data into a multimodal fusion model for corresponding feature extraction to obtain feature vectors for images, audio, water quality, and feed amount; fusing the feature vectors of images, audio, and water quality to obtain a first aggregated feature map; predicting the feed amount for the next round based on the first aggregated feature map; fusing the feature vectors of images, audio, water quality, and feed amount to obtain a second aggregated feature map; and estimating the current fish biomass based on the second aggregated feature map.
[0004] However, the aforementioned existing technologies mainly estimate the overall biomass based on group feeding data and multimodal fusion, without independently identifying and measuring individual fish. They are susceptible to environmental interference such as water quality, background, and noise, and the resistance to background interference and interpretability of fish-by-fish biomass estimation need to be improved. Summary of the Invention
[0005] This application provides a method for fish information recognition and biomass estimation based on binocular images, which aims to solve the problem that the resistance to background interference and interpretability of fish-by-fish biomass estimation need to be improved in existing fish information recognition and biomass estimation technologies.
[0006] On the one hand, this application provides a method for fish information recognition and biomass estimation based on binocular images, including the following steps: Step 1: Obtain the side-by-side binocular images to be processed, and separate them into left and right views according to the preset layout.
[0007] Step 2: Perform fish body target detection and target association in the left view to generate fish body target bounding boxes and target identifiers. Use the fish body target bounding boxes to prompt the fish body segmentation model and generate a fish body mask and a compact original cropping image.
[0008] Step 3: Input the compressed original cropped image into the visual semantic recognition model to obtain the fish species and head orientation.
[0009] Step four: Perform morphological opening and closing operations on the fish body mask, select the fish body contour with the largest area, and extract the length endpoint and width endpoint in combination with the head orientation.
[0010] Step 5: Align and stereo match the left view and the right view to obtain a disparity map corresponding to the left view.
[0011] Step 6: Based on the disparity map, candidate disparity modes are selected within the fish mask. Pixel support and maximum connected component pixel count are determined. The candidate disparity mode with the largest central disparity is selected as the foreground disparity mode. The foreground depth is determined based on the foreground disparity mode.
[0012] Step 7: Estimate the fish body weight based on the foreground depth, the length endpoint, the width endpoint, and the fish species, as biomass.
[0013] In one possible implementation, in step two, the fish body target box is used as a prompt input to the fish body segmentation model to obtain the corresponding fish body mask.
[0014] Expand the target area of the fish body outward by a predetermined ratio, and crop a compact original cropped image from the left view.
[0015] In one possible implementation, in step four, principal component analysis is performed based on the pixel coordinates of the fish body contour with the largest area to obtain the principal axis and minor axis; the two ends of the principal axis are used as candidate length endpoints, and the mouth endpoint and tail endpoint are determined according to the head orientation; two extreme points of the fish body contour are taken in the direction of the minor axis to determine the widest point on the dorsal side and the widest point on the ventral side; the center point of the caudal peduncle is determined at a preset ratio along the reverse direction of the principal axis at the tail endpoint.
[0016] The mouth end point and the tail end point constitute the length end point, and the widest point on the dorsal side and the widest point on the ventral side constitute the width end point.
[0017] In one possible implementation, in step five, the horizontal and vertical offsets of the left and right views are read or set, and the corresponding edge areas of the left and right views are cropped according to the horizontal and vertical offsets so that the retained areas are aligned in the translation direction.
[0018] Perform stereo matching on the aligned left and right views to obtain a disparity map corresponding to the left view.
[0019] In one possible implementation, step six, the selection of the foreground disparity mode, includes: The fish mask is written back to the coordinate system of the left view, and the fish mask is eroded according to the minimum side length of the outer region of the fish mask. Based on the disparity map, the disparity values that meet the effective range are screened in the eroded fish mask. The effective disparity values are binned and statistically analyzed to obtain candidate disparity modes.
[0020] For each candidate disparity mode, the pixel support and the maximum number of connected pixels are calculated. Among the candidate disparity modes where both the pixel support and the maximum number of connected pixels meet the corresponding support threshold, the candidate disparity mode with the largest center disparity is selected as the nearest foreground disparity mode with spatial support.
[0021] In one possible implementation, step six, determining the foreground depth, includes: The disparity of each pixel within the reliable pixel region corresponding to the foreground disparity mode is converted into pixel depth according to the binocular parameters, and the median value of the pixel depth is taken as the foreground depth.
[0022] In one possible implementation, step seven includes: The fish length and fish width are calculated based on the foreground depth, the length endpoint, and the width endpoint.
[0023] The fish weight is estimated based on the fish length, the fish width, and the fish species, and is taken as biomass.
[0024] In one possible implementation, step seven, the calculation of the fish's length and width, includes: The scale per pixel in centimeters is calculated based on the foreground depth and focal length parameters.
[0025] The length of the fish is obtained by multiplying the pixel distance between the length endpoints by a scale of centimeters per pixel, and the width of the fish is obtained by multiplying the pixel distance between the width endpoints by a scale of centimeters per pixel.
[0026] In one possible implementation, step seven, estimating the fish's weight, includes: Call the length-weight parameter that matches the fish species category and fish body length definition, and calculate the base fish body weight based on the fish body length and the length-weight parameter.
[0027] When the preset fish species configuration defines the width correction parameter, the basic fish body weight is corrected according to the fish body width and the width correction parameter to obtain the fish body weight.
[0028] When the width correction parameter is not defined, the base fish weight is used as the fish weight.
[0029] The fish information recognition and biomass estimation method based on binocular images in this application has the following advantages: By decoupling fish species semantic recognition from mask geometric endpoint determination, and selecting the nearest and spatially supported foreground disparity modality within the fish body mask to determine the foreground depth, the resistance to background interference and interpretability of fish-by-fish biomass estimation are improved.
[0030] Principal component analysis based on the maximum fish body contour was used to determine the minor axis of the principal axis, and the mouth and tail endpoints were determined according to the head orientation. The widest point on the dorsal and ventral sides was determined by the extreme value of the minor axis, which improved the geometric consistency and measurement stability of the definition of the endpoints of the fish body length and width.
[0031] By writing back the fish mask and eroding it to filter effective parallax, binning to obtain candidate parallax modes, and then selecting the one with the largest center parallax based on pixel support and the maximum connected component threshold, the ability of the foreground parallax mode to resist background depth and local noise is improved.
[0032] By converting the disparity of each pixel into depth within the reliable pixel region corresponding to the foreground disparity mode and taking the median value as the foreground depth, the robustness of fish foreground depth estimation to abnormal disparity and local depth loss is improved.
[0033] The base weight is calculated by calling the length-weight parameter that matches the fish species and length definition, and the base weight is corrected according to the fish body width when the fish species are configured in the preset configuration, which improves the accuracy of biomass estimation for different fish species and body sizes. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 A flowchart illustrating a method for fish information recognition and biomass estimation based on binocular images, provided in an embodiment of this application; Figure 2 This is a schematic diagram of the geometric endpoint determination based on a fish mask provided in an embodiment of this application, wherein the horizontal dashed line is the main axis and the vertical dashed line is the minor axis; Figure 3 A schematic diagram of foreground parallax mode selection and endpoint depth sampling correction provided for embodiments of this application; Figure 4 Data processing topology diagram for a method of fish information recognition and biomass estimation based on binocular images provided in the embodiments of this application; Figure 5 This is a schematic diagram illustrating the output of fish-by-fish information and summary information provided in the embodiments of this application; Figure 6 This is a schematic diagram illustrating the spatial support determination of candidate disparity modes provided in an embodiment of this application. Figure 7 This is a schematic diagram illustrating the relationship between size and weight calculation in an embodiment of this application.
[0036] Explanation of reference numerals in the attached figures: 1-mouth tip, 2-tail tip, 3-widest point on the dorsal side, 4-widest point on the ventral side, 5-center point of the caudal peduncle. Detailed Implementation
[0037] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0038] like Figure 1 and Figure 4 As shown in the figure, this application provides a method for fish information recognition and biomass estimation based on binocular images, including the following steps: Step 1: Obtain the side-by-side binocular images to be processed, and separate them into left and right views according to the preset layout.
[0039] Step 2: Perform fish body target detection and target association in the left view to generate fish body target bounding boxes and target identifiers. Use the fish body target bounding boxes to prompt the fish body segmentation model and generate a fish body mask and a compact original cropping image.
[0040] Step 3: Input the compressed original cropped image into the visual semantic recognition model to obtain the fish species and head orientation.
[0041] Step four: Perform morphological opening and closing operations on the fish body mask, select the fish body contour with the largest area, and extract the length endpoint and width endpoint in combination with the head orientation.
[0042] Step 5: Align and stereo match the left view and the right view to obtain a disparity map corresponding to the left view.
[0043] Step 6: Based on the disparity map, candidate disparity modes are selected within the fish mask. Pixel support and maximum connected component pixel count are determined. The candidate disparity mode with the largest central disparity is selected as the foreground disparity mode. The foreground depth is determined based on the foreground disparity mode.
[0044] Step 7: Estimate the fish body weight based on the foreground depth, the length endpoint, the width endpoint, and the fish species, as biomass.
[0045] Specifically, in this embodiment, in step one, if a left and right image pair has already been provided, the process can proceed directly to subsequent processing.
[0046] For example, in step two, the fish body target box is used as a prompt input to the fish body segmentation model to obtain the corresponding fish body mask.
[0047] Expand the target area of the fish body outward by a predetermined ratio, and crop a compact original cropped image from the left view.
[0048] Specifically, in this embodiment, in step two, the fish target detection and target association are implemented using existing methods in the art: the left view is input into a pre-trained fish target detection model, and the fish target detection model outputs the bounding boxes of each fish target in the left view and their corresponding confidence scores; the target association is matched based on the intersection-over-union ratio, center distance, or appearance feature similarity between bounding boxes in adjacent image frames, assigning consistent target identifiers to the same fish in different image frames. The fish target detection model can be a target detection network based on convolutional neural networks or Transformer; the above-mentioned fish target detection and target association are existing technologies in the art, and this application does not limit their specific network structure, training data, and training methods.
[0049] Target identifiers are used to distinguish different fish targets in the same image or consecutive images.
[0050] The area is expanded outward from the target bounding box of the fish by a preset ratio of 0.08, and the original cropped image is tightened to preserve the original pixel information of the fish.
[0051] In this embodiment, the candidate boxes generated by automatic detection are not used as subsequent input. The operator adds and confirms the target box with the target identifier F0001-009 before segmentation. This manual input is only used to illustrate the feasibility of subsequent algorithm steps.
[0052] Specifically, in this embodiment, in step three, the visual semantic recognition model is implemented using existing methods in the art: taking the compact original cropped image as input, and outputting the fish species category, classification confidence information, and head orientation after image feature extraction. The visual semantic recognition model can be an image classification network based on a convolutional neural network, or a visual-language multimodal model. The visual-language multimodal model identifies the compact original cropped image according to preset prompts and outputs the fish species category and head orientation. The above-mentioned visual semantic recognition model and its reasoning method are all existing technologies in the art, and this application does not limit its specific network structure, prompt form, and training data.
[0053] The visual semantic recognition model is only used to obtain the fish species category and head orientation, and does not directly output the length or width endpoints. The head orientation is used to determine the head-to-tail correspondence at both ends of the main axis. In this embodiment, the initial result of visual semantic recognition is "grouper", which is overwritten as "cloud dragon grouper" by the operator in the controlled category table.
[0054] like Figure 2 As shown, exemplarily, in step four, principal component analysis is performed based on the pixel coordinates of the fish body contour with the largest area to obtain the principal axis and minor axis; the two ends of the principal axis are used as candidate length endpoints, and the mouth endpoint 1 and tail endpoint 2 are determined according to the head orientation; two extreme points of the fish body contour are taken in the direction of the minor axis to determine the widest point 3 on the dorsal side and the widest point 4 on the ventral side; the center point 5 of the caudal peduncle is determined at a preset ratio in the opposite direction of the principal axis from the tail endpoint 2.
[0055] The mouth end point 1 and the tail end point 2 constitute the length end point, and the widest point on the dorsal side 3 and the widest point on the ventral side 4 constitute the width end point.
[0056] Specifically, in this embodiment, in step four, the tailstock center point 5 is determined at a preset ratio of 0.12 in the opposite direction of the tail end point 2 along the main axis. In this embodiment, the tail end point 2 has been manually checked and corrected once, and the corrected main axis angle is 342.339°.
[0057] For example, in step five, the horizontal and vertical offsets of the left and right views are read or set, and the corresponding edge areas of the left and right views are cropped according to the horizontal and vertical offsets so that the retained areas are aligned in the translation direction.
[0058] Perform stereo matching on the aligned left and right views to obtain a disparity map corresponding to the left view.
[0059] like Figure 3 and Figure 6 As shown, exemplarily, in step six, the selection of the foreground parallax mode includes: The fish mask is written back to the coordinate system of the left view, and the fish mask is eroded according to the minimum side length of the outer region of the fish mask. Based on the disparity map, the disparity values that meet the effective range are screened in the eroded fish mask. The effective disparity values are binned and statistically analyzed to obtain candidate disparity modes.
[0060] For each candidate disparity mode, the pixel support and the maximum number of connected pixels are calculated. Among the candidate disparity modes where both the pixel support and the maximum number of connected pixels meet the corresponding support threshold, the candidate disparity mode with the largest center disparity is selected as the nearest foreground disparity mode with spatial support.
[0061] Since a larger disparity value indicates a closer target depth, the foreground disparity mode can reduce the impact of background depth and distant noise on fish depth estimation.
[0062] If the local depth of mouth endpoint 1, tail endpoint 2, dorsal widest point 3, or ventral widest point 4 is unreliable, then an alternative depth sampling position is determined in the reliable pixel area and the depth quality information is output, but the two-dimensional coordinates of the endpoints are not changed, and the alternative depth is not used for size or weight calculation.
[0063] Specifically, in this embodiment, the binocular baseline B is 0.06 m, and the equivalent pixel focal length f is 1550 px; the horizontal offset... The vertical offset is 63 pixels. The value is 56 pixels. During positive offset, the corresponding pixels at the bottom or right of the left view are cropped, and the corresponding pixels at the top or left of the right view are cropped. These parameters are determined using a two-distance parallax zero-point and scale fitting method under air conditions; when deployed underwater, they should be recalibrated according to the actual imaging environment.
[0064] The corrosion radius of the fish body mask is calculated based on the shorter side of the outer region. Determine, perform one erosion using an elliptic kernel; if the number of pixels after erosion is less than ,in If the number of pixels in the fish body mask is [number], then no erosion is performed. Effective parallax satisfies [condition]. Effective depth satisfaction To assess effective parallax and After segmentation and cropping, the bandwidth is divided into boxes using Freedman-Diaconis bandwidth, with bandwidth limited to... to The number of boxes is limited to to and adopt Smoothing is performed to determine the local maxima.
[0065]
[0066] Among them, wb and h b These represent the width and height of the outer region of the fish's body mask, respectively, N. m Z represents the number of pixels in the fish mask, N is the total number of parallax pixels within the fish mask that satisfy the effective range after erosion, r is the erosion radius of the fish mask, and Z is the number of pixels in the fish mask. v Δ represents the depth value of the pixels within the fish body mask. bin The unit for width, height, total number of pixels, erosion radius, and bin bandwidth is pixels, and the unit for depth is meters.
[0067] Candidate disparity modes Pixel support area with tolerance Confirmed; Support threshold is The maximum connected component threshold is The connectivity is Connected.
[0068]
[0069] in, For the first The central disparity of each candidate disparity mode This represents the pixel support level for the candidate disparity mode. This represents the maximum connected component support for the candidate disparity mode. and For the corresponding preset threshold; The central disparity of the selected foreground disparity mode.
[0070] like Figure 3 As shown, candidate disparity modes not only need to have sufficient pixel support, but also need to have the largest connected component that meets the threshold; among the candidate disparity modes that meet this condition, the candidate disparity mode with the largest central disparity is selected. Figure 3 The bar chart is only used to illustrate the relationship between candidate disparity modes, spatial support, and selection rules, and is not an experimental measurement result.
[0071] When performing depth sampling on the mouth endpoint 1, tail endpoint 2, widest point on the dorsal side 3, and widest point on the ventral side 4, the two-dimensional coordinates of each endpoint remain unchanged. If the endpoint has local depth loss, exceeds the effective range, or deviates from the foreground depth, an alternative depth sampling position is determined only within the reliable pixel area corresponding to the selected foreground parallax modality, and this position and its depth value are output as depth quality information; the alternative depth sampling position and its depth value are not included in the calculation of fish length, fish width, or fish weight.
[0072] Endpoint local depth adopted The neighborhood median is used for determination; when the local depth is missing, greater than 1, the median of the neighborhood is used for determination; when the local depth is missing, the median of the neighborhood is used for determination. Foreground depth or less When the foreground depth is doubled, the alternative depth sampling position is determined at the reliable pixel within the etched mask that is closest to the endpoint Euclidean distance. Depth quality information includes the number of effective depth pixels, the number of pixels in the fish mask, foreground parallax, the median absolute deviation of the foreground depth, the foreground parallax mode support ratio, the number of pixels supporting the foreground parallax mode, the mask etch radius, the number of endpoint depth sampling adjustments, the endpoint depth sampling adjustment information, and the depth processing status.
[0073] For example, in step six, determining the foreground depth includes: The disparity of each pixel within the reliable pixel region corresponding to the foreground disparity mode is converted into pixel depth according to the binocular parameters, and the median value of the pixel depth is taken as the foreground depth.
[0074] Specifically, in this embodiment, the formula for calculating the foreground depth in step six is as follows:
[0075] in, For the depth of the prospect, For focal length parameters, Baseline parameters, For the first reliable pixel region The parallax of one pixel.
[0076] For example, step seven includes: The fish length and fish width are calculated based on the foreground depth, the length endpoint, and the width endpoint.
[0077] The fish weight is estimated based on the fish length, the fish width, and the fish species, and is taken as biomass.
[0078] For example, in step seven, the calculation of the fish's length and width includes: The scale per pixel in centimeters is calculated based on the foreground depth and focal length parameters.
[0079] The length of the fish is obtained by multiplying the pixel distance between the length endpoints by a scale of centimeters per pixel, and the width of the fish is obtained by multiplying the pixel distance between the width endpoints by a scale of centimeters per pixel.
[0080] Specifically, in this embodiment, the formula for calculating the centimeter-per-pixel scale in step seven is as follows:
[0081] in, The pixel size is in centimeters.
[0082] The formulas for calculating the length and width of a fish are as follows:
[0083] in, The pixel distance between the mouth endpoint 1 and the tail endpoint 2. The pixel distance between the widest point 3 on the back side and the widest point 4 on the front side. The length of the fish's body. The width of the fish's body.
[0084] For example, in step seven, the estimation of the fish's weight includes: Call the length-weight parameter that matches the fish species category and fish body length definition, and calculate the base fish body weight based on the fish body length and the length-weight parameter.
[0085] When the preset fish species configuration defines the width correction parameter, the basic fish body weight is corrected according to the fish body width and the width correction parameter to obtain the fish body weight.
[0086] When the width correction parameter is not defined, the base fish weight is used as the fish weight.
[0087] Specifically, in this embodiment, the formula for calculating the base fish weight in step seven is as follows:
[0088] in, Based on the base fish body weight and The length-weight parameter is designed to match the fish species and body length definition. The endpoints of the body length should be defined in accordance with the calibration calibrator of the corresponding parameter. When the parameter is calibrated according to the total length, the tail endpoint 2 is taken as the extreme point of the main axis of the posterior edge of the caudal fin. When the parameter is calibrated according to the length of the caudal fork, the tail endpoint 2 is taken as the concave point of the caudal fork. The concave point of the caudal fork is the indentation between the upper and lower lobes of the caudal fin, which is a different position from the aforementioned center point 5 of the caudal peduncle.
[0089] When a width correction parameter is defined in the preset fish species configuration, the base fish weight is corrected based on the fish body width. The width correction parameter and its correction method are determined by the growth parameters of the corresponding fish species. If this parameter is not defined, the base fish weight is used as the fish body weight. Finally, the target identifier, fish species category, body length, body width, weight, foreground depth, and depth mass information for each fish are output, and the quantity, average body length, average body width, average weight, or total biomass are summarized according to the fish species category. Figure 5 As shown.
[0090] like Figure 7 As shown, foreground parallax, binocular parameters, and geometric endpoints are used to calculate depth, pixel scale, and size, respectively, while fish species are used to select length-weight parameters. Figure 7This is used to illustrate the relationship between size and weight calculations and does not represent experimental measurements or accuracy verification results for any particular fish species.
[0091] Example 1: Taking a set of binocular image processing results as an example, the operator adds and confirms a fish target with the target identifier F0001-009. The fish target is initially classified as "grouper" by semantic recognition of the compact cropping image, and then overwritten as "cloud dragon grouper" in the controlled category table; then the mouth endpoint 1, tail endpoint 2, the widest point on the dorsal side 3, and the widest point on the ventral side 4 are obtained by fish body mask geometry extraction.
[0092] Candidate disparity modes and spatial support are determined for the effective disparity within the fish mask to obtain the foreground depth calculation results. The corresponding fish-by-fish algorithm output is shown in Table 1: Table 1. Output of the fish-by-fish algorithm in Example 1
[0093] In this example, the candidate bounding boxes, fish species categories, and tail endpoint 2 all involved manual input, overwriting, or correction. Based on the confirmed input, subsequent alignment, stereo matching, foreground disparity modality selection, size calculation, and weight calculation were completed by the algorithm. No manual measured control data was used to evaluate the accuracy of this single output.
[0094] The embodiments of this application decouple fish species semantic recognition from mask geometric endpoint determination, and select the nearest foreground disparity modality with spatial support within the fish body mask to determine the foreground depth, thereby improving the resistance to background interference and interpretability of fish-by-fish biomass estimation.
[0095] Principal component analysis based on the maximum fish body contour was used to determine the minor axis of the principal axis, and the mouth and tail endpoints were determined according to the head orientation. The widest point on the dorsal and ventral sides was determined by the extreme value of the minor axis, which improved the geometric consistency and measurement stability of the definition of the endpoints of the fish body length and width.
[0096] By writing back the fish mask and eroding it to filter effective parallax, binning to obtain candidate parallax modes, and then selecting the one with the largest center parallax based on pixel support and the maximum connected component threshold, the ability of the foreground parallax mode to resist background depth and local noise is improved.
[0097] By converting the disparity of each pixel into depth within the reliable pixel region corresponding to the foreground disparity mode and taking the median value as the foreground depth, the robustness of fish foreground depth estimation to abnormal disparity and local depth loss is improved.
[0098] The base weight is calculated by calling the length-weight parameter that matches the fish species and length definition, and the base weight is corrected according to the fish body width when the fish species are configured in the preset configuration, which improves the accuracy of biomass estimation for different fish species and body sizes.
[0099] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0100] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for fish information recognition and biomass estimation based on binocular images, characterized in that, Includes the following steps: Step 1: Obtain the side-by-side binocular images to be processed, and separate them into left and right views according to the preset layout; Step 2: In the left view, fish target detection and target association are performed to generate fish target bounding boxes and target identifiers. The fish target bounding boxes are used to prompt the fish segmentation model to generate a fish mask and a compact original cropping image. Step 3: Input the compressed original cropped image into the visual semantic recognition model to obtain the fish species and head orientation; Step 4: Perform morphological opening and closing operations on the fish body mask, select the fish body contour with the largest area, and extract the length endpoint and width endpoint in combination with the head orientation; Step 5: Align and stereo match the left view and the right view to obtain a disparity map corresponding to the left view; Step 6: Based on the disparity map, candidate disparity modes are selected within the fish mask. Pixel support and maximum connected component pixel count are determined. The candidate disparity mode with the largest central disparity is selected as the foreground disparity mode. The foreground depth is determined based on the foreground disparity mode. Step 7: Estimate the fish body weight based on the foreground depth, the length endpoint, the width endpoint, and the fish species, as biomass.
2. The method for fish information recognition and biomass estimation based on binocular images according to claim 1, characterized in that, In step two, the target bounding box of the fish body is used as a prompt input to the fish body segmentation model to obtain the corresponding fish body mask; Expand the target area of the fish body outward by a predetermined ratio, and crop a compact original cropped image from the left view.
3. The method for fish information recognition and biomass estimation based on binocular images according to claim 1, characterized in that, In step four, principal component analysis is performed based on the pixel coordinates of the fish body contour with the largest area to obtain the principal axis and minor axis; the two ends of the principal axis are used as candidate length endpoints, and the mouth endpoint and tail endpoint are determined according to the head orientation. Take two extreme points of the fish's body outline along the short axis to determine the widest point on the dorsal side and the widest point on the ventral side. Determine the center point of the tailstock at a preset ratio along the main shaft from the tail end point. The mouth end point and the tail end point constitute the length end point, and the widest point on the dorsal side and the widest point on the ventral side constitute the width end point.
4. The method for fish information recognition and biomass estimation based on binocular images according to claim 1, characterized in that, In step five, the horizontal and vertical offsets of the left and right views are read or set, and the corresponding edge areas of the left and right views are cropped according to the horizontal and vertical offsets so that the retained areas are aligned in the translation direction. Perform stereo matching on the aligned left and right views to obtain a disparity map corresponding to the left view.
5. The method for fish information recognition and biomass estimation based on binocular images according to claim 1, characterized in that, In step six, the selection of the foreground disparity mode includes: The fish mask is written back to the coordinate system of the left view, and the fish mask is eroded according to the minimum side length of the outer region of the fish mask. Based on the disparity map, the disparity values that meet the effective range are screened in the eroded fish mask. The effective disparity values are binned and statistically analyzed to obtain candidate disparity modes. For each candidate disparity mode, the pixel support and the maximum number of connected pixels are calculated. Among the candidate disparity modes where both the pixel support and the maximum number of connected pixels meet the corresponding support threshold, the candidate disparity mode with the largest center disparity is selected as the nearest foreground disparity mode with spatial support.
6. The method for fish information recognition and biomass estimation based on binocular images according to claim 1, characterized in that, Step six, determining the foreground depth, includes: The disparity of each pixel within the reliable pixel region corresponding to the foreground disparity mode is converted into pixel depth according to the binocular parameters, and the median value of the pixel depth is taken as the foreground depth.
7. The method for fish information recognition and biomass estimation based on binocular images according to claim 1, characterized in that, Step seven includes: Calculate the fish length and fish width based on the foreground depth, the length endpoint, and the width endpoint; The fish weight is estimated based on the fish length, the fish width, and the fish species, and is taken as biomass.
8. The method for fish information recognition and biomass estimation based on binocular images according to claim 7, characterized in that, In step seven, the calculation of the fish's length and width includes: The scale per pixel in centimeters is calculated based on the foreground depth and focal length parameters. The length of the fish is obtained by multiplying the pixel distance between the length endpoints by a scale of centimeters per pixel, and the width of the fish is obtained by multiplying the pixel distance between the width endpoints by a scale of centimeters per pixel.
9. The method for fish information recognition and biomass estimation based on binocular images according to claim 7, characterized in that, In step seven, the estimation of the fish's weight includes: Call the length-weight parameter that matches the fish species category and fish body length definition, and calculate the base fish body weight based on the fish body length and the length-weight parameter; When the preset fish species configuration defines the width correction parameter, the basic fish body weight is corrected according to the fish body width and the width correction parameter to obtain the fish body weight; When the width correction parameter is not defined, the base fish weight is used as the fish weight.
Citation Information
Patent Citations
Fish biomass estimation method and system based on deep learning multi-modal fusion model
CN119271987A
