Fish body fish disease warning method and system based on image analysis
Through image analysis technology, the edges of fish body are identified, combined with shape and grayscale characteristics, and a fish body posture model is constructed, which solves the problem of inefficiency in traditional fish disease monitoring methods, and achieves efficient and accurate monitoring and timely early warning of fish body health status.
Patent Information
- Application Number
- CN202510519282.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-08-08
AI Technical Summary
Traditional fish disease monitoring methods are difficult to achieve efficient and accurate assessment of the healthy state of fish, resulting in delayed discovery of fish disease and limited prevention and control effects.
Through image analysis technology, the edge of the fish body is identified, combined with shape, motion and grayscale characteristics, a fish body posture model is constructed, abnormal areas are locked, and a comprehensive assessment is made whether the fish disease alarm is triggered.
It realizes efficient and accurate monitoring of the health status of fish, provides timely fish disease warning support, and improves the management efficiency and effectiveness of aquaculture.
Smart Images

Figure CN120452014A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fish state analysis, and in particular to a fish disease warning method and system based on image analysis. Background Art
[0002] With the rapid expansion of the aquaculture industry, timely monitoring and effective prevention and control of fish diseases have become crucial for ensuring aquaculture production and economic benefits. However, traditional fish disease monitoring methods suffer from significant technical deficiencies and application effectiveness, making them unable to meet the precision and automation demands of modern aquaculture. Manual observation relies on the experience and judgment of aquaculture personnel, which is not only inefficient but also makes it difficult to conduct detailed and continuous monitoring of the individual status of large-scale fish populations, which can easily lead to misjudgments or omissions. While water quality testing can reflect environmental changes, it cannot directly reveal specific health abnormalities in fish, making early warnings less targeted. While laboratory analysis is accurate, it is complex and time-consuming, making it unsuitable for real-time monitoring. These methods generally lack automation support, making it difficult to achieve efficient and accurate assessments of fish health, resulting in delayed detection of fish diseases and limited prevention and control effectiveness. Summary of the Invention
[0003] The purpose of the present invention is to provide a fish disease warning method and system that can accurately monitor the status of fish in a timely manner.
[0004] The present invention discloses a fish disease warning method based on image analysis, comprising:
[0005] Step S100, acquiring a water area image, and using visual analysis technology to identify fish bodies and delineate the edges of the fish bodies to obtain fish body edges;
[0006] Step S200, determining the shape characteristics and motion characteristics of the fish body edge, and determining the posture of the fish body based on the shape characteristics, and determining whether the fish body is in an abnormal state based on the posture and motion characteristics of the fish body;
[0007] Step S300: Grayscale the image area within the edge of the fish body, determine the grayscale features at different locations on the fish body, compare the determined grayscale features with a preset normal fish body grayscale representation model, and based on the comparison results, identify areas with abnormal grayscale features and record them as abnormal grayscale areas;
[0008] Step S400, based on the analysis of the abnormal grayscale area within the edge of the fish body and whether the fish body is in an abnormal state, determine whether to alarm for fish disease.
[0009] In an embodiment disclosed in the present invention, the method for analyzing the shape characteristics of the edge of a fish body includes:
[0010] Step S201, constructing a fish body edge comparison library, wherein the fish body edge comparison library includes a plurality of fish body edge parameter groups, and each fish body edge parameter group corresponds to a fish body posture expression model;
[0011] Step S202: perform parameter analysis on the fish body edge to obtain a fish body edge parameter group, substitute the fish body edge parameter group into the fish body edge comparison library, and determine the corresponding fish body posture expression model.
[0012] In an embodiment disclosed in the present invention, a method for performing parametric analysis on the edge of a fish body includes:
[0013] Step S2021: setting a number of edge detection points at a preset interval for the edge of the fish body, calculating the average coordinates of the edge detection points, and recording the position of the average coordinates as the center detection point;
[0014] Step S2022: Set a number of spacing scan lines passing through the center detection point, and each spacing scan line simultaneously triggers a set of relative edge detection points. Calculate the relative inter-detection point distances between the edge detection points, and screen out the maximum relative inter-detection point distance. Record the spacing scan line corresponding to the maximum relative inter-detection point distance as the maximum spacing scan line. Lock a number of spacing scan lines whose offset angle with the maximum spacing scan line is less than or equal to a preset value and record them as adjacent spacing scan lines. The lengths of the maximum spacing scan line and the adjacent spacing scan lines are identified as parameters of the fish body edge.
[0015] In step S2023, the number of edge detection points on the edge of the fish body is used as the parameter of the fish body edge, and the lengths of the maximum spacing scanning line and the adjacent spacing scanning lines are combined to form a fish body edge parameter group.
[0016] In an embodiment disclosed in the present invention, a method for substituting a fish body edge parameter group into a fish body edge comparison library for retrieval includes:
[0017] Step S203, using the number of edge detection points as a first search condition, searching for a number of corresponding fish body edge parameter groups in a fish body edge comparison library, and recording them as candidate fish body edge parameter groups;
[0018] Step S204, comparing the fish body edge parameter group obtained in real time with each candidate fish body edge parameter group, and determining a difference in the number of edge detection points and a parameter equivalent to the scan line length of the spacing scan lines during each comparison, wherein the scan line length equivalent parameter is determined based on a difference in the scan line lengths between the maximum spacing scan lines and a difference in the scan line lengths between adjacent spacing scan lines;
[0019] Step S205, based on the difference in the number of detection points and the equivalent parameters of the scanning line length, determine the degree of equivalence between the fish body edge parameter groups, and based on the degree of equivalence, determine the fish body edge parameter group called in the fish body edge comparison library, and identify its corresponding fish body posture expression model as the current posture expression of the fish body.
[0020] In an embodiment disclosed in the present invention, a method for constructing a fish posture representation model includes:
[0021] Step S2011: constructing a fish head node component for the fish head part, and constructing a fish tail node component for the fish tail part;
[0022] Step S2012: Based on the bending characteristics of the fish during movement, a number of turning line segments are set, the turning line segments are connected end to end, and the end of the front turning line segment is connected to the fish head node component, and the end of the last turning line segment is connected to the fish tail node component;
[0023] Step S2013: construct an upper body node component for the upper part of the fish body, and configure the upper body node component on the upper side of the turning line segment.
[0024] In an embodiment disclosed in the present invention, a method for determining whether a fish is abnormal based on its posture and movement characteristics includes:
[0025] Step S206, performing posture analysis on the fish posture performance model to determine whether the fish posture performance model has tilted for more than a first preset time length. If so, it is determined that the fish has an abnormal posture.
[0026] Step S207, analyze the angular offset between the fish head node component and the fish tail node component, and construct the angle offset curve as a function of time. The angle offset curve is analyzed. If the peak value is less than a preset value, it is determined that the fish body has abnormal movement. If the time interval between the peaks is greater than or equal to the preset value, and the number of times this situation occurs within the preset time is greater than or equal to the preset value, it is determined that the fish body has abnormal movement.
[0027] In an embodiment disclosed in the present invention, the method for determining the grayscale features at different positions on the fish body includes:
[0028] Step S301: After graying the image area within the edge of the fish body, a grayscale image of the fish body is obtained. Several grayscale detection points are set in the grayscale image of the fish body, and several grayscale detection blocks are randomly selected. The grayscale variance values between the grayscale detection points in the grayscale detection blocks are measured, and the average grayscale variance values of all grayscale detection blocks are calculated.
[0029] Step S302: Grayscale detection points in the fish body grayscale image whose continuous grayscale variance values are less than or equal to the average grayscale variance value are locked to form abnormal grayscale sub-regions, and the regional distance between the abnormal grayscale sub-regions is determined. If the regional distance is less than or equal to a preset value, the abnormal grayscale sub-regions are connected to form an abnormal grayscale region;
[0030] Step S303, determine the area of each abnormal grayscale region, and calculate the area ratio of the abnormal grayscale region to the fish body grayscale image. If the area ratio is greater than or equal to a preset value, the abnormal grayscale region is determined to be a symptom manifestation region.
[0031] In the embodiments disclosed in the present invention, a fish disease warning system based on image analysis is also disclosed, comprising:
[0032] The first module is used to obtain water area images and use visual analysis technology to identify fish bodies and delineate the edges of fish bodies to obtain fish body edges;
[0033] The second module is used to determine the shape characteristics and movement characteristics of the fish body edge, and determine the posture of the fish body based on the shape characteristics, and determine whether the fish body has an abnormal state based on the posture and movement characteristics of the fish body;
[0034] The third module is used to grayscale the image area within the edge of the fish body, determine the grayscale features at different locations on the fish body, and compare the determined grayscale features with the preset normal fish body grayscale representation model. Based on the comparison results, the area with abnormal grayscale features is identified and recorded as an abnormal grayscale area;
[0035] The fourth module is used to determine whether to alarm for fish disease based on the analysis of abnormal grayscale areas within the edge of the fish body and whether there is any abnormal state of the fish body.
[0036] The present invention discloses a fish disease warning method based on image analysis, which relates to the technical field of fish status analysis, including: obtaining an image of a water area, using visual analysis technology to identify fish and delineate their edges; analyzing the shape and motion characteristics of the fish edge, determining the fish posture based on the shape characteristics, and judging whether the fish has an abnormal state by combining the posture and motion characteristics; grayscale processing the image area within the fish edge, extracting grayscale features at different positions, comparing them with a preset normal fish grayscale representation model, and locking abnormal grayscale areas; combining the analysis of abnormal grayscale areas and the judgment of abnormal fish status to determine whether a fish disease alarm is triggered. The present invention overcomes the shortcomings of traditional methods in individual identification and real-time performance by combining image analysis technology with a comprehensive evaluation of shape, motion, and grayscale characteristics, and can efficiently and accurately monitor the health status of fish, providing reliable technical support for aquaculture.
[0037] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a diagram of the steps of a fish disease warning method based on image analysis disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The technical solution of the present invention is further described below with reference to the accompanying drawings and embodiments.
[0040] The following will be combined with the accompanying drawings and specific embodiments to clearly and completely describe the technical solutions of the present invention. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention and cannot be understood as limiting the scope of protection of the present invention. Those skilled in the art in this field can make some non-essential improvements and adjustments based on the content of the present invention described below. In the present invention, unless otherwise clearly specified and limited, the technical terms used in the present invention should have the common meanings understood by those skilled in the art of the present invention.
[0041] Example:
[0042] The purpose of the present invention is to provide a fish disease warning method and system that can accurately monitor the status of fish in a timely manner.
[0043] The present invention discloses a fish disease warning method based on image analysis, see Figure 1 ,include:
[0044] Step S100: Acquire a water area image, and use visual analysis technology to identify the fish body and delineate the edge of the fish body to obtain the edge of the fish body.
[0045] Step S100 is the basic link of the fish disease warning method based on image analysis. Its core principle is to achieve accurate identification and edge extraction of fish bodies through image acquisition and visual analysis technology, laying the foundation for subsequent feature analysis. Specifically, first, use an underwater camera or similar equipment to obtain real-time images in the water area. These images contain information about the fish and the water background. Due to the complex water environment, factors such as light refraction, water flow disturbance and fish density may cause image noise or target blur, so the original image needs to be preprocessed, such as denoising, contrast enhancement, etc., to improve image quality. Next, visual analysis technology is used to identify the fish body. This process usually relies on computer vision algorithms, such as convolutional neural networks (CNN) based on deep learning or traditional edge detection methods (such as the Canny algorithm). By training the model or setting the threshold, the system can distinguish the fish body from the background in the image and identify the contour area of the fish body. After the identification is completed, the edge of the fish body is further delineated, that is, the boundary line of the fish body is accurately outlined through edge detection technology to generate the edge of the fish body. This process may involve image segmentation techniques (such as region growing or watershed algorithms) to ensure the continuity and accuracy of edges. The key to edge delineation is to capture the complete shape of the fish body and avoid misjudgment due to fish overlap or background interference. The obtained fish body edge is not only the basis for subsequent shape and motion analysis, but also provides a clear area range for grayscale feature extraction. The principle of the entire step relies on the combination of image processing and pattern recognition technology, aiming to extract reliable fish body information from complex water environments and provide high-quality initial data for fish disease monitoring. Its accuracy directly affects the reliability of subsequent analysis.
[0046] Step S200, determining the shape characteristics and motion characteristics of the edge of the fish body, and determining the posture of the fish body based on the shape characteristics, and determining whether the fish body is in an abnormal state based on the posture and motion characteristics of the fish body.
[0047] The principle of step S200 is to quantitatively analyze the shape characteristics and motion characteristics of the fish body edge, combine the posture and dynamic behavior to determine whether the fish body is in an abnormal state, and provide a dynamic basis for fish disease early warning. First, the shape characteristics of the fish body edge are determined, and based on the edge contour obtained in step S100, key geometric parameters such as edge curvature, aspect ratio or perimeter area ratio are extracted. These parameters are matched with the pre-built fish body edge comparison library through parametric analysis (as described in steps S202-S205) to determine the specific posture performance model of the fish body. The principle of posture analysis is to abstract the static shape of the fish body into a mathematical description, and use a variety of posture templates stored in the comparison library (such as normal swimming, tilting or curling up) to identify the current posture state of the fish body by calculating the degree of equivalence of the edge parameter group. At the same time, the determination of motion features relies on time-series analysis of multiple frames. By tracking the displacement, velocity, or trajectory changes of the fish's edges in consecutive frames, its dynamic behavior is quantified. Based on a comprehensive analysis of posture and motion features, the system determines whether the fish has any abnormal state, such as prolonged sideways tilt (step S206) or weakened movement (step S207). These abnormalities may reflect a decrease in the fish's mobility due to illness. In principle, this step combines static shape analysis with dynamic behavior assessment, utilizing mathematical modeling and time-series data processing to overcome the limitations of single feature analysis, ensure the comprehensiveness and accuracy of abnormality judgments, and provide an important basis for subsequent disease identification.
[0048] In step S300, the image area within the edge of the fish body is grayscaled to determine the grayscale features at different positions on the fish body, and the determined grayscale features are compared with the preset normal fish body grayscale representation model. Based on the comparison results, the area where the abnormal grayscale features exist is locked and recorded as the abnormal grayscale area.
[0049] The principle of step S300 is to grayscale the image area within the edge of the fish body, extract and analyze the grayscale features of the fish body surface, and compare them with a preset normal model, thereby identifying potential disease areas and providing a texture basis for fish disease diagnosis. First, the image area within the edge of the fish body is grayscaled, that is, the color image is converted into a grayscale image. This process is based on the mapping of RGB values to a single grayscale value (such as the weighted average method) to reduce computational complexity and highlight the light and dark changes on the fish body surface. After grayscale conversion, the system calculates the grayscale features at different locations on the fish body by setting grayscale detection points and detection blocks (step S301). These features reflect the color distribution and texture characteristics of the fish body surface. Next, the extracted grayscale features are compared with a preset normal fish body grayscale representation model. This model is usually constructed based on historical data of healthy fish bodies and includes the grayscale range and distribution pattern under normal conditions. Through this comparison, the system identifies grayscale value areas that deviate from the normal model and marks them as abnormal grayscale features. The locking of abnormal grayscale areas (steps S302-S303) relies on grayscale variance analysis and regional connection algorithms. If the grayscale variance of a region is lower than the average value and is close to other abnormal sub-regions, it will be connected to form a complete abnormal grayscale region. The area ratio of the region is further calculated. If it exceeds the preset threshold, it is identified as a symptom manifestation area. The principle of this process is to use the statistical characteristics of image texture to quantify the pathological changes on the fish surface (such as spots and ulcers) through grayscale differences, and combine spatial correlation to improve the accuracy of regional division, providing quantitative evidence for the final judgment of fish disease.
[0050] Step S400, based on the analysis of the abnormal grayscale area within the edge of the fish body and whether the fish body is in an abnormal state, determine whether to alarm for fish disease.
[0051] The principle behind step S400 is to combine analysis of abnormal grayscale areas within the fish's periphery with the determination of abnormal state. Multidimensional data fusion is then used to achieve a final alarm decision regarding fish disease, ensuring the reliability and practicality of the monitoring results. First, based on the abnormal grayscale areas identified in step S300, the system conducts an in-depth analysis of the abnormal grayscale areas, including their size, distribution, and degree of grayscale variation. These indicators reflect the severity and extent of surface symptoms on the fish. For example, large areas of abnormal grayscale may indicate severe skin lesions, while localized abnormalities may be associated with parasitic infestations. Simultaneously, combined with the abnormal state results determined in step S200 (such as lateral tilt or bradykinesia), the system assesses whether these dynamic features correlate with grayscale abnormalities. For example, if a fish exhibits both decreased movement and significant grayscale abnormalities, the likelihood of disease is significantly increased. The decision-making process may employ rule-based reasoning or machine learning models to quantify the weights of grayscale features and abnormal state to calculate a comprehensive abnormality score. If the score exceeds a preset threshold, a fish disease alarm is triggered, notifying the fish farmer to take intervention measures. The principle behind this step is to overcome the limitations of a single indicator through complementary verification of static (grayscale) and dynamic (state) features, while also leveraging data fusion technology to enhance robustness. The design of the alarm mechanism also requires a balance between false alarm and missed alarm rates, ensuring timely detection of issues in complex aquatic environments while avoiding unnecessary interference, thereby providing efficient and accurate health management support for aquaculture.
[0052] In an embodiment disclosed in the present invention, the method for analyzing the shape characteristics of the edge of a fish body includes:
[0053] Step S201: construct a fish body edge comparison library, which includes several fish body edge parameter groups, and each fish body edge parameter group corresponds to a fish body posture expression model.
[0054] The principle of step S201 is to pre-build a fish body edge comparison library to provide a standardized reference database for subsequent fish body posture identification and matching, thereby achieving efficient analysis of fish body shape features and posture determination. This step first requires collecting edge data in multiple fish body states, which is usually achieved by edge extraction of images of healthy fish bodies in different postures (such as normal swimming, tilting, curling up, etc.). After edge extraction, these edge contours are converted into parameterized description forms, i.e., fish body edge parameter groups. These parameter groups may include geometric features of the edge (such as length, width, curvature) and distribution characteristics of key points, and each group of parameters corresponds to a specific fish body posture performance model one-to-one. The process of building the comparison library relies on the combination of data collection and pattern induction. For example, through statistical analysis of a large number of fish body samples, the edge feature range under typical postures is determined, and the edge parameters are associated with the posture model using clustering algorithms or manual annotation. The core principle of the comparison library is to abstract the complex fish body shape into a quantifiable parameter set, which is stored and managed in the form of a database so that the edge matching in the subsequent steps can quickly call standard templates for comparison. This approach is similar to template matching techniques in pattern recognition, but emphasizes the dynamic association between parameterization and posture. Once constructed, the fish edge comparison library not only provides a reference for shape features but also lays the foundation for identifying abnormalities in fish condition. Its advantage lies in reducing the complexity of real-time calculations through pre-set models while ensuring the accuracy and consistency of posture recognition, providing reliable support for automated analysis in fish disease monitoring.
[0055] Step S202: perform parameter analysis on the fish body edge to obtain a fish body edge parameter group, substitute the fish body edge parameter group into the fish body edge comparison library, and determine the corresponding fish body posture expression model.
[0056] In an embodiment disclosed in the present invention, a method for performing parametric analysis on the edge of a fish body includes:
[0057] In step S2021, a number of edge detection points are set at a preset interval for the edge of the fish body, and the average coordinates of the edge detection points are calculated, and the position point of the average coordinates is recorded as the center detection point.
[0058] The principle of step S2021 is to provide a standardized reference coordinate system for subsequent parametric analysis by setting detection points on the edge of the fish body and calculating its geometric center, thereby ensuring the accuracy and consistency of edge feature extraction. Specifically, this step is to evenly distribute a number of edge detection points according to a preset spacing (such as a fixed pixel spacing) for the edge contour of the fish body generated in step S100. These detection points constitute a discrete representation of the edge. The selection of the preset spacing needs to balance the computational complexity and feature resolution, and is usually adjusted according to the size of the fish body and the image resolution. After setting the detection points, the coordinate average of all detection points is calculated, that is, the mean of the horizontal and vertical coordinates of each point is obtained in the two-dimensional image plane, and the obtained average coordinate position is defined as the center detection point. The principle of the center detection point is similar to the geometric centroid calculation, but it pays more attention to the distribution characteristics of the edge contour rather than the filling information of the internal area. This center point not only reflects the spatial center of gravity of the edge of the fish body, but also provides a reference coordinate for the arrangement of subsequent scanning lines.
[0059] Step S2022: set a number of spacing scan lines passing through the center detection point, and each spacing scan line simultaneously triggers a group of relative edge detection points, calculates the relative detection point distances between the edge detection points, and screens out the maximum relative detection point distance, records the spacing scan line corresponding to the maximum relative detection point distance as the maximum spacing scan line, and locks a number of spacing scan lines whose offset angles with the maximum spacing scan line are less than or equal to a preset value, and record them as adjacent spacing scan lines, and identifies the lengths of the maximum spacing scan line and the adjacent spacing scan lines as parameters of the fish body edge.
[0060] The principle of step S2022 is to extract the key geometric parameters of the edge by arranging scan lines on the edge of the fish body and measuring the distance between detection points, thereby providing core data for the quantitative description of the fish body shape. Specifically, this step takes the central detection point determined in step S2021 as the origin, and sets a number of spacing scan lines passing through this point. These scan lines are distributed radially, covering different directions of the edge of the fish body. When each scan line intersects with the edge detection point, it triggers a pair of relative detection points (i.e., the intersection of the two ends of the scan line and the edge), and calculates the Euclidean distance between the two points, which is recorded as the relative distance between detection points. This process is similar to the calculation of diameter or width in geometric measurement, but a full range of characterization of the edge shape is achieved through multi-directional scanning. Next, the maximum value of the distance between relative detection points in all scan lines is screened out, and the corresponding scan line is defined as the maximum spacing scan line, which usually reflects the longest span of the edge of the fish body (such as the length or width of the fish body). Furthermore, several scan lines whose offset angles from the maximum spacing scan line are less than or equal to a preset value (such as 5° or 10°) are locked and recorded as adjacent spacing scan lines. These lines capture edge features close to the maximum span. The lengths of the maximum spacing scan line and its adjacent scan lines are used as parameters of the fish body edge, reflecting the main features and local changes of the shape. In principle, this step utilizes spatial geometry and directional analysis, overcomes the limitations of single-direction measurement through multi-dimensional scanning, and ensures the representativeness of the parameters. The scan line setting and screening process is fully automated, relying on algorithm calculations without the need for manual intervention, thereby improving efficiency and consistency, and providing a reliable quantitative basis for the construction of subsequent parameter groups.
[0061] In step S2023, the number of edge detection points on the edge of the fish body is used as the parameter of the fish body edge, and the lengths of the maximum spacing scanning line and the adjacent spacing scanning lines are combined to form a fish body edge parameter group.
[0062] The principle of step S2023 is to integrate the number of edge detection points and the scan line length into a comprehensive parameter set that fully describes the shape characteristics of the fish edge and provides structured input data for posture matching. Specifically, this step first uses the total number of edge detection points set in step S2021 as one of the parameters. This number reflects the complexity and resolution of the edge contour. For example, more detection points may correspond to finer edge details. Next, combined with the length of the maximum-pitch scan line and its adjacent-pitch scan lines extracted in step S2022, these length parameters quantify the main geometric dimensions of the fish edge, such as the approximate value of the overall length or width. The process of forming the fish edge parameter set is to integrate these independent features (number of detection points and scan line lengths) into a multidimensional vector, such as {number of detection points, maximum-pitch length, adjacent-pitch 1 length, adjacent-pitch 2 length, etc.}. The principle of this parameter set is to comprehensively characterize the shape characteristics of the fish through the combination of multidimensional features, including both global information (maximum pitch reflects overall size) and local details (number of detection points and adjacent-pitch distance reflect edge distribution). The integrated parameter set not only represents a mathematical abstraction of the shape but also provides a standardized input format for library matching in step S202. The parameter set generation process relies entirely on algorithmic calculations, ensuring data consistency and repeatability. Its core advantage lies in simplifying complex edge images into a manageable set of numerical values, facilitating subsequent rapid comparisons with a fish edge library. This enables efficient access to posture models and provides critical support for automated analysis of fish disease monitoring.
[0063] In an embodiment disclosed in the present invention, a method for substituting a fish body edge parameter group into a fish body edge comparison library for retrieval includes:
[0064] In step S203, the number of edge detection points is used as the first search condition, and a corresponding number of fish body edge parameter groups are retrieved from the fish body edge comparison library and recorded as candidate fish body edge parameter groups.
[0065] In step S204, the fish body edge parameter group obtained in real time is compared with each alternative fish body edge parameter group respectively. Each time the comparison is performed, the difference in the number of edge detection points and the equivalent parameter of the scan line length of the spacing scan line are determined respectively. Among them, the equivalent parameter of the scan line length is determined based on the difference in the scan line length between the maximum spacing scan lines and the difference in the scan line length between the adjacent spacing scan lines.
[0066] Step S205, based on the difference in the number of detection points and the equivalent parameters of the scanning line length, determine the degree of equivalence between the fish body edge parameter groups, and based on the degree of equivalence, determine the fish body edge parameter group called in the fish body edge comparison library, and identify its corresponding fish body posture expression model as the current posture expression of the fish body.
[0067] Among them, the expression for calculating the degree of equality between the fish body edge parameter groups is:
[0068]
[0069] Among them, D is the degree of equality, K1 is the conversion coefficient of the degree of equality, G 1~max is the preset reference scan line length difference between the maximum spacing scan lines, G1 is the scan line length difference between the maximum spacing scan lines, R1 is the influence weight coefficient of the scan length difference between the maximum spacing scan lines, G 2~max is the preset reference scan line length difference between adjacent spacing scan lines, G 2~i is the difference in scan line length between the i-th adjacent scan lines, n is the total number of adjacent scan lines in the fish body edge parameter group, R2 is the influence weight coefficient of the difference in scan length between adjacent scan lines, ΔH is the difference in the number of detection points, L is the influence adjustment coefficient of the difference in the number of detection points, and b1 is the influence adjustment constant of the difference in the number of detection points.
[0070] In an embodiment disclosed in the present invention, a method for constructing a fish posture representation model includes:
[0071] Step S2011: constructing a fish head node component for the fish head part, and constructing a fish tail node component for the fish tail part;
[0072] Step S2012: Based on the bending characteristics of the fish body during movement, several turning line segments are set, and the turning line segments are connected end to end. The fish head node component is connected to the end of the front turning line segment, and the fish tail node component is connected to the end of the last turning line segment.
[0073] Step S2013: construct an upper body node component for the upper part of the fish body, and configure the upper body node component on the upper side of the turning line segment.
[0074] In an embodiment disclosed in the present invention, a method for determining whether a fish is abnormal based on its posture and movement characteristics includes:
[0075] Step S206, performing posture analysis on the fish posture performance model to determine whether the fish posture performance model has tilted for more than a first preset time length. If so, it is determined that the fish has an abnormal posture.
[0076] Step S207, analyze the angular offset between the fish head node component and the fish tail node component, and construct the angle offset curve as a function of time. The angle offset curve is analyzed. If the peak value is less than a preset value, it is determined that the fish body has abnormal movement. If the time interval between the peaks is greater than or equal to the preset value, and the number of times this situation occurs within the preset time is greater than or equal to the preset value, it is determined that the fish body has abnormal movement.
[0077] In an embodiment disclosed in the present invention, the method for determining the grayscale features at different positions on the fish body includes:
[0078] Step S301: After graying the image area within the edge of the fish body, a grayscale image of the fish body is obtained, a number of grayscale detection points are set in the grayscale image of the fish body, and a number of grayscale detection blocks are randomly selected. The grayscale variance values between the grayscale detection points in the grayscale detection blocks are measured, and the average grayscale variance values of all grayscale detection blocks are calculated.
[0079] Step S302, the grayscale detection points in the fish body grayscale image whose continuous grayscale variance values are less than or equal to the average grayscale variance value are locked to form abnormal grayscale sub-regions, and the regional distance between the abnormal grayscale sub-regions is determined. If the regional distance is less than or equal to a preset value, the abnormal grayscale sub-regions are connected to form an abnormal grayscale region.
[0080] Step S303, determine the area of each abnormal grayscale region, and calculate the area ratio of the abnormal grayscale region to the fish body grayscale image. If the area ratio is greater than or equal to a preset value, the abnormal grayscale region is determined to be a symptom manifestation region.
[0081] In the embodiments disclosed in the present invention, a fish disease warning system based on image analysis is also disclosed, comprising:
[0082] The first module is used to obtain water area images and use visual analysis technology to identify fish bodies and delineate the edges of fish bodies to obtain fish body edges;
[0083] The second module is used to determine the shape characteristics and movement characteristics of the fish body edge, and determine the posture of the fish body based on the shape characteristics, and determine whether the fish body has an abnormal state based on the posture and movement characteristics of the fish body;
[0084] The third module is used to grayscale the image area within the edge of the fish body, determine the grayscale features at different locations on the fish body, and compare the determined grayscale features with the preset normal fish body grayscale representation model. Based on the comparison results, the area with abnormal grayscale features is identified and recorded as an abnormal grayscale area;
[0085] The fourth module is used to determine whether to alarm for fish disease based on the analysis of abnormal grayscale areas within the edge of the fish body and whether there is any abnormal state of the fish body.
[0086] The present invention discloses a fish disease warning method based on image analysis, which relates to the technical field of fish status analysis, including: obtaining an image of a water area, using visual analysis technology to identify fish and delineate their edges; analyzing the shape and motion characteristics of the fish edge, determining the fish posture based on the shape characteristics, and judging whether the fish has an abnormal state by combining the posture and motion characteristics; grayscale processing the image area within the fish edge, extracting grayscale features at different positions, comparing them with a preset normal fish grayscale representation model, and locking abnormal grayscale areas; combining the analysis of abnormal grayscale areas and the judgment of abnormal fish status to determine whether a fish disease alarm is triggered. The present invention overcomes the shortcomings of traditional methods in individual identification and real-time performance by combining image analysis technology with a comprehensive evaluation of shape, motion, and grayscale characteristics, and can efficiently and accurately monitor the health status of fish, providing reliable technical support for aquaculture.
[0087] Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented through hardware or by using software plus the necessary general hardware platform. Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, a USB flash drive, a mobile hard disk, etc.) and includes a number of instructions for enabling a computer device (such as a personal computer, a server, or a network device) to execute the methods described in various implementation scenarios of the present invention.
[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solutions of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A fish disease warning method based on image analysis, characterized in that: include: Step S100, acquiring a water area image, and using visual analysis technology to identify fish bodies and delineate the edges of the fish bodies to obtain fish body edges; Step S200, determining the shape characteristics and motion characteristics of the fish body edge, and determining the posture of the fish body based on the shape characteristics, and determining whether the fish body is in an abnormal state based on the posture and motion characteristics of the fish body; Step S300: Grayscale the image area within the edge of the fish body, determine the grayscale features at different locations on the fish body, compare the determined grayscale features with a preset normal fish body grayscale representation model, and based on the comparison results, identify areas with abnormal grayscale features and record them as abnormal grayscale areas; Step S400, based on the analysis of the abnormal grayscale area within the edge of the fish body and whether the fish body is in an abnormal state, determine whether to alarm for fish disease.
2. The fish disease warning method based on image analysis according to claim 1, characterized in that: Methods for analyzing the shape characteristics of fish body edges include: Step S201, constructing a fish body edge comparison library, wherein the fish body edge comparison library includes a plurality of fish body edge parameter groups, and each fish body edge parameter group corresponds to a fish body posture expression model; Step S202: perform parameter analysis on the fish body edge to obtain a fish body edge parameter group, substitute the fish body edge parameter group into the fish body edge comparison library, and determine the corresponding fish body posture expression model.
3. The fish disease warning method based on image analysis according to claim 2, characterized in that: Methods for parametric analysis of fish body edges include: Step S2021: setting a number of edge detection points at a preset interval for the edge of the fish body, calculating the average coordinates of the edge detection points, and recording the position of the average coordinates as the center detection point; Step S2022: Set a number of spacing scan lines passing through the center detection point, and each spacing scan line simultaneously triggers a set of relative edge detection points. Calculate the relative inter-detection point distances between the edge detection points, and screen out the maximum relative inter-detection point distance. Record the spacing scan line corresponding to the maximum relative inter-detection point distance as the maximum spacing scan line. Lock a number of spacing scan lines whose offset angle with the maximum spacing scan line is less than or equal to a preset value and record them as adjacent spacing scan lines. The lengths of the maximum spacing scan line and the adjacent spacing scan lines are identified as parameters of the fish body edge. In step S2023, the number of edge detection points on the edge of the fish body is used as the parameter of the fish body edge, and the lengths of the maximum spacing scanning line and the adjacent spacing scanning lines are combined to form a fish body edge parameter group.
4. The fish disease warning method based on image analysis according to claim 3, characterized in that: The method of substituting the fish body edge parameter group into the fish body edge comparison library for retrieval includes: Step S203, using the number of edge detection points as a first search condition, searching for a number of corresponding fish body edge parameter groups in a fish body edge comparison library, and recording them as candidate fish body edge parameter groups; Step S204, comparing the fish body edge parameter group obtained in real time with each candidate fish body edge parameter group, and determining a difference in the number of edge detection points and a parameter equivalent to the scan line length of the spacing scan lines during each comparison, wherein the scan line length equivalent parameter is determined based on a difference in the scan line lengths between the maximum spacing scan lines and a difference in the scan line lengths between adjacent spacing scan lines; Step S205, based on the difference in the number of detection points and the equivalent parameters of the scanning line length, determine the degree of equivalence between the fish body edge parameter groups, and based on the degree of equivalence, determine the fish body edge parameter group called in the fish body edge comparison library, and identify its corresponding fish body posture expression model as the current posture expression of the fish body.
5. The fish disease warning method based on image analysis according to claim 2, characterized in that: Methods for constructing fish posture representation models include: Step S2011: constructing a fish head node component for the fish head part, and constructing a fish tail node component for the fish tail part; Step S2012: Based on the bending characteristics of the fish during movement, a number of turning line segments are set, the turning line segments are connected end to end, and the end of the front turning line segment is connected to the fish head node component, and the end of the last turning line segment is connected to the fish tail node component; Step S2013: construct an upper body node component for the upper part of the fish body, and configure the upper body node component on the upper side of the turning line segment.
6. The fish body and fish cake warning method based on image analysis according to claim 5, characterized in that: Methods for determining whether a fish is abnormal based on its posture and movement characteristics include: Step S206, performing posture analysis on the fish posture performance model to determine whether the fish posture performance model has tilted for more than a first preset time length. If so, it is determined that the fish has an abnormal posture. Step S207, analyze the angular offset between the fish head node component and the fish tail node component, and construct the angle offset curve as a function of time. The angle offset curve is analyzed. If the peak value is less than a preset value, it is determined that the fish body has abnormal movement. If the time interval between the peaks is greater than or equal to the preset value, and the number of times this situation occurs within the preset time is greater than or equal to the preset value, it is determined that the fish body has abnormal movement.
7. The fish disease warning method based on image analysis according to claim 1, characterized in that: Methods for determining the grayscale features at different locations on the fish body include: Step S301: After graying the image area within the edge of the fish body, a grayscale image of the fish body is obtained. Several grayscale detection points are set in the grayscale image of the fish body, and several grayscale detection blocks are randomly selected. The grayscale variance values between the grayscale detection points in the grayscale detection blocks are measured, and the average grayscale variance values of all grayscale detection blocks are calculated. Step S302: Grayscale detection points in the fish body grayscale image whose continuous grayscale variance values are less than or equal to the average grayscale variance value are locked to form abnormal grayscale sub-regions, and the regional distance between the abnormal grayscale sub-regions is determined. If the regional distance is less than or equal to a preset value, the abnormal grayscale sub-regions are connected to form an abnormal grayscale region; Step S303, determine the area of each abnormal grayscale region, and calculate the area ratio of the abnormal grayscale region to the fish body grayscale image. If the area ratio is greater than or equal to a preset value, the abnormal grayscale region is determined to be a symptom manifestation region.
8. Fish disease warning system based on image analysis, characterized by: The fish disease warning method for implementing any one of claims 1 to 7 comprises: The first module is used to obtain water area images and use visual analysis technology to identify fish bodies and delineate the edges of fish bodies to obtain fish body edges; The second module is used to determine the shape characteristics and movement characteristics of the fish body edge, and determine the posture of the fish body based on the shape characteristics, and determine whether the fish body has an abnormal state based on the posture and movement characteristics of the fish body; The third module is used to grayscale the image area within the edge of the fish body, determine the grayscale features at different locations on the fish body, and compare the determined grayscale features with the preset normal fish body grayscale representation model. Based on the comparison results, the area with abnormal grayscale features is identified and recorded as an abnormal grayscale area; The fourth module is used to determine whether to alarm for fish disease based on the analysis of abnormal grayscale areas within the edge of the fish body and whether there is any abnormal state of the fish body.