Fish morphological skeleton extraction method and device based on improved OTSU and dynamic DBSCAN

CN122906716APending Publication Date: 2026-10-13GUANGDONG MODERN AGRI EQUIP RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611004833.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-07
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0004]本发明提供一种基于改进OTSU与动态DBSCAN的鱼类形态骨架提取方法及装置,解决传统方法在处理高分辨率鱼类图像时存在的内存消耗大、骨架断裂、对成像噪声敏感等问题,提升鱼类形态骨架提取的完整性、连续性和鲁棒性,为后续形态参数测量提供高质量的数据支撑

Benefits of technology

[0015]本发明的有益技术效果至少在于以下:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122906716A_ABST
    Figure CN122906716A_ABST
Patent Text Reader

Abstract

The application relates to a fish morphological skeleton extraction method and device based on improved OTSU and dynamic DBSCAN. The application aims to solve the problems of low efficiency, insufficient precision and easy breaking of skeleton extraction in traditional fish morphological measurement. By acquiring a high-resolution fish image, sequentially performing data preprocessing, binaryzation segmentation by using an improved OTSU algorithm, morphological skeleton feature point extraction and optimization, and cluster processing by using an improved dynamic DBSCAN algorithm, a fish morphological skeleton line is finally generated and morphological parameters are calculated. The application combines intelligent optimization algorithm and adaptive clustering technology, realizes automatic, high-precision extraction and analysis of fish morphology, and significantly improves processing efficiency and algorithm stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart fisheries technology, and in particular to a method and apparatus for extracting fish morphological skeletons based on an improved OTSU and dynamic DBSCAN. Background Technology

[0002] In fish breeding, fishery resource surveys, and aquaculture, accurate acquisition of fish morphological parameters is a crucial foundation for conducting related research and production activities. Traditional measurement methods rely on manual contact measurements using tools such as vernier calipers. This is not only labor-intensive and inefficient, but also easily affected by the operator's subjective judgment and experience, resulting in poor repeatability and comparability of measurement data, making it difficult to meet the needs of large-scale and intelligent applications.

[0003] Traditional DBSCAN algorithms use fixed parameter settings, making it difficult to adapt to individual differences in fish morphology and dynamic changes in point cloud distribution when processing fish images. This leads to problems such as broken skeletons and insufficient clustering accuracy. Furthermore, they consume a lot of memory when processing high-resolution images, limiting their efficiency in practical applications. Some improved solutions attempt to optimize the OTSU or DBSCAN algorithms individually, but fail to fully consider the synergistic effect of image segmentation and clustering processes. Improvements to single modules cannot effectively address issues such as noise interference and insufficient skeleton continuity in complex imaging environments, resulting in limited overall extraction performance improvements and failing to meet the precise processing requirements of high-resolution fish images. Therefore, there is an urgent need for a fish morphology skeleton extraction scheme that balances segmentation accuracy, clustering stability, and computational efficiency to achieve reliable automated measurement of fish morphological parameters in complex scenes. Summary of the Invention

[0004] This invention provides a method and apparatus for extracting fish morphological skeletons based on an improved OTSU and dynamic DBSCAN, which solves the problems of high memory consumption, skeleton breakage, and sensitivity to imaging noise in traditional methods when processing high-resolution fish images. It improves the integrity, continuity and robustness of fish morphological skeleton extraction, and provides high-quality data support for subsequent morphological parameter measurement.

[0005] To achieve the above objectives, a method for extracting fish morphological skeletons based on improved OTSU and dynamic DBSCAN is provided in a first aspect of the present invention, comprising the following steps: Acquire high-resolution fish images; The high-resolution fish images are preprocessed to remove noise and smooth the image. An improved OTSU algorithm is used to perform binarization segmentation on the preprocessed image to separate the foreground and background of the fish. Extract morphological skeleton feature points of fish, and optimize the feature points by dimensionality reduction and sorting to reduce memory load and ensure connection order; An improved dynamic DBSCAN algorithm is used to cluster the optimized feature points to generate the skeleton lines of the fish body. Fish morphological parameters are calculated based on the generated skeleton lines, and the measurement results data are output.

[0006] Furthermore, the improved OTSU algorithm is used to perform binarization segmentation on the preprocessed image, specifically including: The whale optimization algorithm is used to simulate encirclement predation and bubble net attack behaviors. The inter-class variance is used as the fitness function to perform directional exploration and global search in the gray-level solution space to determine the optimal binarization threshold. The image is binarized based on the optimal threshold to achieve accurate separation of the foreground and background.

[0007] Furthermore, the data preprocessing of the high-resolution fish image specifically includes: Invalid samples with motion blur or occlusion are removed to ensure data validity; Median filtering is used to smooth the image, removing salt-and-pepper noise and random noise; White balance correction and lens distortion calibration are performed to improve the consistency of image data.

[0008] Furthermore, the extraction of fish morphological skeleton feature points, and the dimensionality reduction and sorting optimization of these feature points, specifically includes: The distance from the pixel to the background is calculated by distance transformation, which is used to extract candidate regions for skeleton feature points; Local extremum detection is used to screen for local maximum points, which reduces the size of candidate points and lowers memory load; A rotating coordinate system is established based on the biological characteristics of the fish, and a point set projection sorting strategy based on the main axis direction of the fish is adopted to ensure that the skeletal points are connected in an orderly manner along the biological anatomical axis.

[0009] Furthermore, the improved dynamic DBSCAN algorithm is used to cluster the optimized feature points, specifically including: The clustering radius parameter is adaptively set based on the distribution characteristics of fish point clouds to adapt to different fish shapes; A KD-Tree index structure is introduced to index feature points, which improves the efficiency of neighborhood search. Combined with an alternative path fault tolerance mechanism, when an anomaly occurs in local clustering, the path is automatically switched for connection to enhance the stability of the algorithm.

[0010] Furthermore, after generating the skeletal outline of the fish body, the process also includes: Spline smoothing is used to smooth the skeleton lines generated by clustering, in order to eliminate jagged burrs; Distinguish the outline points of the abdomen and back to generate a complete central axis that conforms to the physiological structure of the fish.

[0011] Furthermore, the calculation of fish morphological parameters based on the generated skeletal lines specifically includes: Calculate the length of the skeleton lines, which will be used as a body length parameter; The maximum vertical distance from the skeletal line to the fish's body outline is measured and used as parameters for body thickness and height.

[0012] Furthermore, acquiring high-resolution fish images specifically includes: An industrial camera was used to take pictures in an environment equipped with a white uniform background and a ring LED light source to create a high-contrast background; A ring-shaped LED light source is used to provide diffused lighting, which reduces shadows and uneven lighting on the fish.

[0013] Secondly, the present invention also provides a fish morphological skeleton extraction device based on improved OTSU and dynamic DBSCAN, comprising: The image acquisition module is used to acquire high-resolution images of fish. The data preprocessing module is used to preprocess the high-resolution fish images, including noise removal and smoothing. The image segmentation module is used to perform binarization segmentation on the preprocessed image using an improved OTSU algorithm to separate the foreground and background of the fish. The feature point processing module is used to extract morphological skeleton feature points of fish and perform dimensionality reduction and sorting optimization on the feature points to reduce memory load and ensure connection order. The clustering skeleton generation module is used to cluster the optimized feature points using an improved dynamic DBSCAN algorithm to generate the skeleton lines of the fish body shape. The parameter output module is used to calculate fish morphological parameters based on the generated skeleton lines and output measurement result data.

[0014] Thirdly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when executed by a processor, the program implements the steps of the fish morphological skeleton extraction method based on the improved OTSU and dynamic DBSCAN as described in any one of the claims.

[0015] The beneficial technical effects of the present invention are at least as follows: This invention provides a method and apparatus for extracting fish morphological skeletons based on an improved OTSU and dynamic DBSCAN. By constructing an image processing workflow that integrates intelligent optimization algorithms and adaptive clustering strategies, it effectively solves the technical challenges faced in extracting morphological skeletons from high-resolution fish images, such as high memory consumption, skeleton fragmentation, and noise sensitivity. In the image preprocessing stage, motion blur and occlusion samples are removed, and median filtering, white balance correction, and lens distortion calibration are combined to ensure the validity and consistency of the input data. In the image segmentation stage, an improved OTSU method based on the whale optimization algorithm is introduced. Using inter-class variance as the fitness function, a global search is performed in the gray-level solution space to determine the optimal binarization threshold, achieving accurate separation of the fish foreground and background. In the feature point processing stage, candidate skeleton points are extracted through distance transformation and local extremum detection, and a projection sorting strategy based on the fish's principal axis is adopted. This not only compresses the data size and reduces memory load but also ensures the orderly connection of skeleton points along the biological anatomical axis.

[0016] It is evident that by introducing a dynamic DBSCAN clustering algorithm based on the distribution characteristics of fish point clouds, the clustering radius parameter can be adaptively adjusted. Combined with the KD-Tree index structure, the efficiency of neighborhood search can be improved. Furthermore, the fault tolerance mechanism of alternative paths can be used to enhance the connection stability of the algorithm under complex morphologies. By performing spline smoothing on the generated skeleton lines, jagged burrs can be effectively eliminated. The complete central axis generated after distinguishing the contour points of the abdomen and back is more consistent with the physiological structure of the fish. The body length, body thickness, and body height parameters calculated based on this skeleton line provide high-precision data support for fish morphology research and aquaculture automation, thereby achieving the effects of improving the efficiency of high-resolution image processing, reducing resource consumption, and generating continuous and complete skeleton lines. Attached Figure Description

[0017] The present invention will be further described with reference to the accompanying drawings, but the embodiments in the drawings do not constitute any limitation on the present invention. For those skilled in the art, other drawings can be obtained based on the following drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating the working steps of a fish morphological skeleton extraction method based on improved OTSU and dynamic DBSCAN, as disclosed in one embodiment of the present invention. Figure 2 This is a flowchart disclosed in one embodiment of the present invention; Figure 3 This is a schematic diagram of a fish morphological skeleton extraction device based on improved OTSU and dynamic DBSCAN, disclosed in one embodiment of the present invention. Detailed Implementation

[0019] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0020] Example 1

[0021] refer to Figures 1-2 This invention provides an embodiment of a method for extracting fish morphological skeletons based on improved OTSU and dynamic DBSCAN, comprising the following steps: S1. Acquire high-resolution fish images; S2. Perform data preprocessing on the high-resolution fish image to remove noise and perform smoothing. S3. The improved OTSU algorithm is used to perform binarization segmentation on the preprocessed image to separate the foreground and background of the fish. S4. Extract the morphological skeleton feature points of the fish body, and perform dimensionality reduction and sorting optimization on the feature points to reduce memory load and ensure connection order; S5. An improved dynamic DBSCAN algorithm is used to cluster the optimized feature points to generate the skeleton lines of the fish body. S6. Calculate fish morphological parameters based on the generated skeleton lines and output measurement results data.

[0022] In a specific embodiment of the present invention, the specific implementation process of the fish morphological skeleton extraction method based on improved OTSU and dynamic DBSCAN is as follows: The process involves acquiring and preprocessing high-resolution fish images. High-resolution image acquisition equipment is used to acquire fish images under a uniform white background and ring-shaped LED diffused lighting environment, eliminating shadows and uneven lighting. The images are then preprocessed. This preprocessing specifically includes smoothing the images using a median filtering algorithm to remove salt-and-pepper noise and random noise generated during image acquisition, while simultaneously performing white balance correction and lens distortion calibration. This improves the consistency and quality of the image data, providing a standardized data foundation for subsequent segmentation processing.

[0023] Binarization segmentation based on an improved OTSU algorithm is implemented. The improved OTSU algorithm is used to process the preprocessed image to achieve accurate separation of the fish foreground and background. Specifically, this algorithm uses a whale optimization algorithm to simulate biological predation behavior, performing a global search in the gray-level solution space with inter-class variance as the fitness function to determine the optimal binarization threshold. Binarizing the image based on this optimal threshold effectively overcomes the influence of uneven illumination, achieving accurate segmentation of the foreground fish body from the background. Distance transformation is used to calculate the distance from pixels to the background, extracting candidate regions for skeleton feature points. Local extremum detection is used to filter local maximum points, thereby compressing the candidate point size and reducing memory load. Based on this, a rotated coordinate system is established based on the biological characteristics of the fish body. A point set projection sorting strategy based on the fish body's principal axis is used to optimize the dimensionality and sorting of feature points, ensuring that skeleton points are connected in an orderly manner along the biological anatomical axis. The clustering radius parameter is adaptively set according to the distribution characteristics of the fish point cloud, and a KD-Tree index structure is introduced to index the optimized feature points to improve neighborhood search efficiency. During the clustering process, a fault-tolerant mechanism for alternative paths is incorporated. When anomalies occur in local clustering, paths are automatically switched for connection, thereby enhancing the algorithm's stability and ultimately generating continuous and complete skeletal lines for the fish's body morphology. The skeletal lines generated by clustering are then smoothed using splines to eliminate jagged edges, and the ventral and dorsal contour points are distinguished to generate a complete central axis that conforms to the fish's physiological structure. Based on this, the length of the skeletal lines is calculated as the body length parameter, and the maximum vertical distance from the skeletal lines to the fish's contour is measured as the body thickness and height parameters, ultimately outputting accurate measurement results.

[0024] Furthermore, the improved OTSU algorithm is used to perform binarization segmentation on the preprocessed image, specifically including: The whale optimization algorithm is used to simulate encirclement predation and bubble net attack behaviors. The inter-class variance is used as the fitness function to perform directional exploration and global search in the gray-level solution space to determine the optimal binarization threshold. The image is binarized based on the optimal threshold to achieve accurate separation of the foreground and background.

[0025] In this embodiment, the specific implementation process of using the improved OTSU algorithm for binarization segmentation of the preprocessed image is as follows: The system calls the whale optimization algorithm module, constructing a global search mechanism by simulating the surrounding predation behavior and bubble net attack behavior of whale groups. Specifically, the algorithm uses inter-class variance as the fitness function, and performs directional exploration and iterative optimization in the gray-level solution space of the image, gradually approaching and determining the optimal binarization threshold. This process effectively overcomes the defect of the traditional OTSU algorithm being prone to getting trapped in local optima. After obtaining the optimal threshold, the system performs binarization operation on the preprocessed image, determining the areas with pixel gray values ​​higher than the threshold as the fish foreground and the areas with gray values ​​lower than the threshold as the background, thereby achieving high-precision separation of the foreground and background and providing clear binary image input for subsequent skeleton extraction.

[0026] The improved OTSU segmentation algorithm combines the whale optimization algorithm with the traditional OTSU algorithm, fully utilizing the global search capability of the whale optimization algorithm to optimize the threshold selection process. The traditional OTSU algorithm iterates through 256 gray levels, calculates the inter-class variance for each gray level, and uses the gray level with the maximum inter-class variance as the optimal threshold. In contrast, the whale optimization-based OTSU algorithm simulates the surrounding predation and bubble-web attack behavior of whales, performing a targeted search within the gray-level solution space.

[0027] In the specific implementation, the whale population is first initialized, with each individual whale corresponding to a possible threshold solution. The fitness function for each individual is calculated, using inter-class variance as the evaluation metric. Through iterative updates of the whale population, including behaviors such as encirclement predation, bubble web attacks, and random search, the optimal threshold is gradually approached. During the iteration process, the search strategy is dynamically adjusted based on the fitness function value to ensure that the algorithm can escape local optima and find the globally optimal threshold.

[0028] This improved algorithm can adaptively adjust the threshold search path, exhibiting stronger robustness in complex image scenes while reducing the number of threshold search iterations and improving segmentation efficiency. Images processed by this algorithm show more thorough separation between the fish foreground and background, maintaining the integrity of the fish region even in noisy images, laying a solid foundation for subsequent feature point extraction.

[0029] Feature point processing first extracts morphological skeleton feature points of the fish body through distance transformation. Distance transformation can calculate the distance from each pixel in the image to the nearest background pixel. Pixels with larger distance values ​​correspond to the central axis region of the fish body, which is the candidate region for skeleton feature points. Then, the local extremum detection method is used to process the distance-transformed image, and the local maximum points are selected as skeleton feature points, which effectively compresses the size of the candidate points and reduces the memory load of subsequent clustering processing.

[0030] Local extremum detection uses a local maximum filter size of 10 and a local maximum threshold set to 0.4 times the maximum distance value to filter out feature points that meet the criteria. Subsequently, a rotated coordinate system is established based on the biological characteristics of the fish, using the fish's principal axis as the main axis direction. Coordinate transformation maps the fish feature points to the new coordinate system. A point set projection sorting strategy based on the fish's principal axis direction is employed to sort the feature points along this direction, ensuring that the extracted skeletal points are connected in an orderly manner along the biological anatomical axis, avoiding skeletal fragmentation. Simultaneously, the maximum number of skeletal points is limited to 500 to further optimize the feature point set size and improve subsequent processing efficiency.

[0031] The dynamic DBSCAN clustering algorithm first analyzes the point set after feature point processing and adaptively adjusts the clustering parameters based on the distribution characteristics of the point cloud. Traditional DBSCAN algorithms use a fixed clustering radius and minimum number of cluster points, making it difficult to adapt to the morphological differences of different fish and variations in point cloud distribution, easily leading to over-clustering or under-clustering. In this improved algorithm, the clustering radius (Eps parameter) is dynamically adjusted according to the fish length, and the minimum number of cluster points is set to 3, ensuring accurate differentiation between the belly and back contour points of the fish.

[0032] Furthermore, the data preprocessing of the high-resolution fish image specifically includes: Invalid samples with motion blur or occlusion are removed to ensure data validity; Median filtering is used to smooth the image, removing salt-and-pepper noise and random noise; White balance correction and lens distortion calibration are performed to improve the consistency of image data.

[0033] Furthermore, the extraction of fish morphological skeleton feature points, and the dimensionality reduction and sorting optimization of these feature points, specifically includes: The distance from the pixel to the background is calculated by distance transformation, which is used to extract candidate regions for skeleton feature points; Local extremum detection is used to screen for local maximum points, which reduces the size of candidate points and lowers memory load; A rotating coordinate system is established based on the biological characteristics of the fish, and a point set projection sorting strategy based on the main axis direction of the fish is adopted to ensure that the skeletal points are connected in an orderly manner along the biological anatomical axis.

[0034] Furthermore, the improved dynamic DBSCAN algorithm is used to cluster the optimized feature points, specifically including: The clustering radius parameter is adaptively set based on the distribution characteristics of fish point clouds to adapt to different fish shapes; A KD-Tree index structure is introduced to index feature points, which improves the efficiency of neighborhood search. Combined with an alternative path fault tolerance mechanism, when an anomaly occurs in local clustering, the path is automatically switched for connection to enhance the stability of the algorithm.

[0035] In this embodiment, a KD-Tree index structure is introduced to index feature points during the clustering process. The KD-Tree can quickly find the neighboring points of each point, improving the efficiency of clustering calculations and reducing memory consumption. Simultaneously, an alternative path fault-tolerance mechanism is introduced. When anomalies occur in the clustering of feature points in a certain region, the algorithm can automatically select an alternative path for clustering, enhancing the stability of the algorithm when handling complex situations.

[0036] After clustering, the results are analyzed to select clusters that match the characteristics of the fish's midline. A complete fish morphological skeleton is then generated through spline smoothing. The spline smoothing parameter is set to 50 to ensure smooth and continuous skeleton lines that accurately reflect the direction of the fish's midline. The maximum number of points on the abdomen and back is limited to 200 to avoid excessive redundancy that could affect the accuracy of the skeleton and the efficiency of subsequent parameter calculations.

[0037] Furthermore, after generating the skeletal outline of the fish body, the process also includes: Spline smoothing is used to smooth the skeleton lines generated by clustering, in order to eliminate jagged burrs; Distinguish the outline points of the abdomen and back to generate a complete central axis that conforms to the physiological structure of the fish.

[0038] In this embodiment, morphological skeletal feature points of the fish are extracted through distance transformation, and data dimensionality reduction is achieved by combining local extremum detection, thereby compressing the candidate point size to reduce memory load. A rotating coordinate system is established based on the biological characteristics of the fish, and a point set projection sorting strategy based on the principal axis direction of the fish is adopted to ensure that the extracted skeletal points are connected in an orderly manner along the biological anatomical axis, avoiding skeletal fragmentation.

[0039] Furthermore, the calculation of fish morphological parameters based on the generated skeletal lines specifically includes: Calculate the length of the skeleton lines, which will be used as a body length parameter; The maximum vertical distance from the skeletal line to the fish's body outline is measured and used as parameters for body thickness and height.

[0040] Furthermore, acquiring high-resolution fish images specifically includes: An industrial camera was used to take pictures in an environment equipped with a white uniform background and a ring LED light source to create a high-contrast background; A ring-shaped LED light source is used to provide diffused lighting, which reduces shadows and uneven lighting on the fish.

[0041] This embodiment also includes performance evaluation, which uses four core indicators to comprehensively assess the algorithm's extraction effect. The connectivity indicator measures the completeness of the fish body region; a higher value indicates a more complete fish body region and a more ideal segmentation effect. The decision time indicator records the computation time required for the algorithm to output a complete analysis result from the input image, directly reflecting the algorithm's efficiency. The comprehensive score indicator integrates the normalized connectivity score, skeleton continuity score, clustering quality score, and efficiency score in a weighted manner, with weights of 0.2, 0.3, 0.3, and 0.2 respectively, comprehensively reflecting the overall performance of the algorithm. The skeleton clustering quality indicator is calculated using the silhouette coefficient, which ranges from -1 to 1. The closer the value is to 1, the higher the internal consistency of the skeleton point clusters and the better the clustering quality.

[0042] Based on the extracted fish skeleton, key morphological parameters such as body length, body thickness, and body height were calculated using geometric methods. Body length was obtained by calculating the length of the skeletal lines, while body thickness and height were obtained by measuring the maximum vertical distance from the skeletal lines to the fish's outline. After calculation, the skeleton image and morphological parameter data were output to support subsequent analysis and applications. refer to Figure 3 This embodiment also provides a fish morphological skeleton extraction device based on improved OTSU and dynamic DBSCAN, including: The image acquisition module is used to acquire high-resolution images of fish. The data preprocessing module is used to preprocess the high-resolution fish images, including noise removal and smoothing. The image segmentation module is used to perform binarization segmentation on the preprocessed image using an improved OTSU algorithm to separate the foreground and background of the fish. The feature point processing module is used to extract morphological skeleton feature points of fish and perform dimensionality reduction and sorting optimization on the feature points to reduce memory load and ensure connection order. The clustering skeleton generation module is used to cluster the optimized feature points using an improved dynamic DBSCAN algorithm to generate the skeleton lines of the fish body shape. The parameter output module is used to calculate fish morphological parameters based on the generated skeleton lines and output measurement result data.

[0043] In the specific implementation process, the image acquisition module is used to acquire high-resolution fish images, employing a high-precision industrial camera as the image acquisition device, with a resolution set to 6720×4480 pixels. It is equipped with a uniform white background and a ring-shaped LED light source, which provides diffused illumination to reduce shadows, reflections, and uneven lighting on the fish during data acquisition.

[0044] The data preprocessing module is used to process the acquired raw images. First, invalid samples with severe motion blur, occlusion, or non-target interference are removed. Then, Gaussian noise is added to some images to simulate actual imaging interference. Finally, median filtering is used to smooth all images. While removing salt and pepper noise and random noise, the edge structure of the fish is preserved and the boundary clarity is maintained, providing high-quality input for subsequent processing.

[0045] The image segmentation module employs an improved OTSU segmentation algorithm based on the whale optimization algorithm to achieve accurate separation of the fish foreground and background. The whale optimization algorithm simulates the predatory and bubble-web attacks of whales in nature to perform a global optimal solution search. Combining this with the OTSU algorithm leverages the global search capability of the whale optimization algorithm to optimize the threshold selection process of the OTSU algorithm, replacing the traditional traversal search strategy of the OTSU algorithm. It performs targeted exploration in the solution space, improving the accuracy and efficiency of threshold selection.

[0046] The feature point processing module is used to extract and optimize morphological skeletal feature points of fish. First, skeletal feature points are extracted through distance transformation, and data dimensionality reduction is achieved by combining local extremum detection, effectively compressing the size of candidate points to reduce memory load. Then, a rotating coordinate system is established based on the biological characteristics of the fish, and a point set projection sorting strategy based on the principal axis of the fish is adopted to ensure that the extracted skeletal points are connected in an orderly manner along the biological anatomical axis, suppressing skeletal fragmentation.

[0047] The clustering skeleton generation module employs an improved DBSCAN clustering algorithm based on dynamic parameter adjustment to cluster the dimensionality-reduced feature points. The clustering radius is adaptively set according to the distribution characteristics of the fish point cloud, avoiding overfitting or underfitting issues caused by fixed parameters. Simultaneously, a KD-Tree index structure is introduced for acceleration, improving algorithm processing efficiency, and an alternative path fault-tolerance mechanism enhances algorithm stability, generating a complete skeleton line that conforms to the fish's morphology.

[0048] The parameter output module is used to calculate the morphological parameters of the generated skeleton, output key morphological parameters such as fish body length, body thickness, and body height, and save the skeleton image and measurement data for subsequent analysis.

[0049] This embodiment also provides a computer-readable storage medium storing a computer program thereon, characterized in that, when executed by a processor, the program implements the steps of the fish morphological skeleton extraction method based on the improved OTSU and dynamic DBSCAN as described in any one of the embodiments.

[0050] In the description of this specification, the references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0051] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for extracting fish morphological skeletons based on improved OTSU and dynamic DBSCAN, characterized in that, Includes the following steps: Acquire high-resolution fish images; The high-resolution fish images are preprocessed to remove noise and smooth the image. An improved OTSU algorithm is used to perform binarization segmentation on the preprocessed image to separate the foreground and background of the fish. Extract morphological skeleton feature points of fish, and optimize the feature points by dimensionality reduction and sorting to reduce memory load and ensure connection order; An improved dynamic DBSCAN algorithm is used to cluster the optimized feature points to generate the skeleton lines of the fish body. Fish morphological parameters are calculated based on the generated skeleton lines, and the measurement results data are output.

2. The method for extracting fish morphological skeletons based on improved OTSU and dynamic DBSCAN according to claim 1, characterized in that, The improved OTSU algorithm is used to perform binarization segmentation on the preprocessed image, specifically including: The whale optimization algorithm is used to simulate encirclement predation and bubble net attack behaviors. The inter-class variance is used as the fitness function to perform directional exploration and global search in the gray-level solution space to determine the optimal binarization threshold. The image is binarized based on the optimal threshold to achieve accurate separation of the foreground and background.

3. The method for extracting fish morphological skeletons based on improved OTSU and dynamic DBSCAN according to claim 1, characterized in that, The data preprocessing of the high-resolution fish image specifically includes: Invalid samples with motion blur or occlusion are removed to ensure data validity; Median filtering is used to smooth the image, removing salt-and-pepper noise and random noise; White balance correction and lens distortion calibration are performed to improve the consistency of image data.

4. The method for extracting fish morphological skeletons based on improved OTSU and dynamic DBSCAN according to claim 1, characterized in that, The extraction of morphological skeletal feature points from the fish body, followed by dimensionality reduction and sorting optimization of these feature points, specifically includes: The distance from the pixel to the background is calculated by distance transformation, which is used to extract candidate regions for skeleton feature points; Local extremum detection is used to screen for local maximum points, which reduces the size of candidate points and lowers memory load; A rotating coordinate system is established based on the biological characteristics of the fish, and a point set projection sorting strategy based on the main axis direction of the fish is adopted to ensure that the skeletal points are connected in an orderly manner along the biological anatomical axis.

5. The method for extracting fish morphological skeletons based on improved OTSU and dynamic DBSCAN according to claim 1, characterized in that, The improved dynamic DBSCAN algorithm is used to cluster the optimized feature points, specifically including: The clustering radius parameter is adaptively set based on the distribution characteristics of fish point clouds to adapt to different fish shapes; A KD-Tree index structure is introduced to index feature points, which improves the efficiency of neighborhood search. Combined with an alternative path fault tolerance mechanism, when an anomaly occurs in local clustering, the path is automatically switched for connection to enhance the stability of the algorithm.

6. The method for extracting fish morphological skeletons based on improved OTSU and dynamic DBSCAN according to claim 1, characterized in that, After generating the skeletal outline of the fish body, the process also includes: Spline smoothing is used to smooth the skeleton lines generated by clustering, in order to eliminate jagged burrs; Distinguish the outline points of the abdomen and back to generate a complete central axis that conforms to the physiological structure of the fish.

7. The method for extracting fish morphological skeletons based on improved OTSU and dynamic DBSCAN according to claim 1, characterized in that, The calculation of fish morphological parameters based on the generated skeleton lines specifically includes: Calculate the length of the skeleton lines, which will be used as a body length parameter; The maximum vertical distance from the skeletal line to the fish's body outline is measured and used as parameters for body thickness and height.

8. The method for extracting fish morphological skeletons based on improved OTSU and dynamic DBSCAN according to claim 1, characterized in that, The acquisition of high-resolution fish images specifically includes: An industrial camera was used to take pictures in an environment equipped with a white uniform background and a ring LED light source to create a high-contrast background; A ring-shaped LED light source is used to provide diffused lighting, which reduces shadows and uneven lighting on the fish.

9. A fish morphological skeleton extraction device based on improved OTSU and dynamic DBSCAN, characterized in that, include: The image acquisition module is used to acquire high-resolution images of fish. The data preprocessing module is used to preprocess the high-resolution fish images, including noise removal and smoothing. The image segmentation module is used to perform binarization segmentation on the preprocessed image using an improved OTSU algorithm to separate the foreground and background of the fish. The feature point processing module is used to extract morphological skeleton feature points of fish and perform dimensionality reduction and sorting optimization on the feature points to reduce memory load and ensure connection order. The clustering skeleton generation module is used to cluster the optimized feature points using an improved dynamic DBSCAN algorithm to generate the skeleton lines of the fish body shape. The parameter output module is used to calculate fish morphological parameters based on the generated skeleton lines and output measurement result data.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the fish morphological skeleton extraction method based on the improved OTSU and dynamic DBSCAN as described in any one of claims 1-8.