Fish intelligent monitoring system and method
By using the fish body recognition module and SORT algorithm in the fish intelligent monitoring system for fish body tracking, combined with the key frame extraction of color feature similarity and depth feature similarity, the difficulty in balancing accuracy and efficiency in fish passage data monitoring is solved. solve the problem and achieve more efficient and accurate fish passage data monitoring.
Patent Information
- Application Number
- CN202311418191.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2043-10-30
AI Technical Summary
The existing intelligent fish monitoring system is difficult to balance the accuracy and efficiency in the monitoring of fish passage data, especially in the underwater dim environment, the video frame brightness of the fish images is uneven, resulting in insufficient monitoring accuracy.
An intelligent fish monitoring system is adopted, including a data acquisition module, a fish body recognition module, a target tracking module and a trajectory identification module. The fish body detection results in fish school images are obtained in real time through the fish body recognition module, and the SORT algorithm is used to perform multiple Target tracking consumes less computing resources and has fast computing speed.
By extraction based on color characteristics similarity, fish body shape feature similarity, and depth characteristic similarity extraction extraction, it can remove the brightness interference and jitter caused by light changes in the video frame, improve the accuracy and accuracy and accuracy and accuracy of fish road data monitoring. efficiency.
Smart Images

Figure CN117423133B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of fish monitoring, and in particular relates to a fish intelligent monitoring system and method. Background Art
[0002] Analyzing the effectiveness of fishway operation by monitoring the number of fish passing through the fishway and guiding the optimization of fishway operation conditions is of great value in alleviating the impact of hydropower projects on fish. In the process of planning, design and demonstration of water conservancy hubs, the adverse impacts on water ecology and mitigation measures have always been the focus of attention of all parties. After comprehensive demonstration, the construction of fishways and the increase of fish populations were listed as the main protection measures to alleviate the impact of the project. The existing fishway fish passing monitoring technology mainly directly identifies the target of the acquired fish school images, but it does not take into account that due to the dim underwater, fill light operation is generally performed during video recording, resulting in uneven brightness of the video frames of the acquired fish school images, resulting in insufficient accuracy of fishway fish passing data monitoring. At the same time, the existing technology ignores efficiency when performing brightness balancing operations on fishway images; the monitoring method of the existing fish intelligent monitoring system cannot balance the accuracy and efficiency of fishway fish passing data monitoring. Summary of the invention
[0003] In view of the above-mentioned deficiencies in the prior art, the present invention provides a fish intelligent monitoring system and method which solves the problem that the monitoring method of the existing fish intelligent monitoring system cannot balance the accuracy and efficiency of fish passage data monitoring.
[0004] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is: a fish intelligent monitoring system, including a data acquisition module, a fish body recognition module, a target tracking module and a trajectory discrimination module;
[0005] The data acquisition module is used to acquire images of fish schools in the river section;
[0006] The fish body recognition module is used to recognize fish bodies in the fish school image and obtain fish body detection results;
[0007] The target tracking module is used to track the fish body using the SORT algorithm according to the fish school image and the fish body detection result to obtain the fish body tracking result;
[0008] The trajectory identification module is used to calculate the amount of fish passing through the fishway and obtain the fish passing time according to the fish body tracking result, so as to obtain the fish passing monitoring result of the fishway.
[0009] The beneficial effects of the present invention are as follows: the present invention acquires the fish body detection results in the fish school image in real time through the fish body recognition module, and simultaneously utilizes the SORT algorithm to track multiple targets, with low computing resource consumption and high computing speed.
[0010] The present invention provides a fish intelligent monitoring method, comprising the following steps:
[0011] S1, obtaining fish school images in the river section;
[0012] S2, obtaining key frames of the fish school image, and performing target detection on the key frames of the fish school image to obtain fish body detection results;
[0013] S3, cutting the fish school image according to the fish body detection result to obtain a number of fish school image segments;
[0014] S4, tracking the fish body according to the image fragments of each fish school, and obtaining the fish body tracking result by using the SORT algorithm;
[0015] S5. According to the fish body tracking result, track identification is performed to obtain the fish passage monitoring result.
[0016] The beneficial effects of the present invention are as follows: the present invention extracts key frames of fish school images based on color feature similarity, fish body shape feature similarity and depth feature similarity, and analyzes fish passage data based on the key frames, which can remove brightness interference and jitter problems caused by illumination changes in video frames, reduce illumination differences in fish passage images caused by underwater monitoring, eliminate uneven brightness of video frames, and obtain stronger detail expression, reduce mutual interference of image scene information, and improve the accuracy of fish passage data monitoring. At the same time, based on the fish body data of the key frames, the SORT algorithm is used to track multiple targets, with low consumption of computing resources and high computing speed.
[0017] Furthermore, the step S2 is specifically as follows:
[0018] S201, obtaining a fish school video sequence according to the fish school image;
[0019] S202, obtaining adjacent frames of each video frame in the fish school video sequence to obtain an adjacent frame sequence;
[0020] S203, performing color feature extraction and similarity calculation based on the fish school video sequence and the adjacent frame sequence, and obtaining the color feature similarity between each video frame and the adjacent frame;
[0021] S204, extracting fish body shape features and calculating similarity based on the fish school video sequence and the adjacent frame sequence, and obtaining the fish body shape feature similarity between each video frame and the adjacent frame;
[0022] S205, according to the fish school video sequence and the adjacent frame sequence, using the Alex-Net convolutional neural network model and the Hamming distance to respectively perform deep feature extraction and similarity calculation to obtain the deep feature similarity between each video frame and the adjacent frames;
[0023] S206, according to the color feature similarity between each video frame and the adjacent frames, the fish body shape feature similarity between each video frame and the adjacent frames, and the depth feature similarity between each video frame and the adjacent frames, respectively obtain the weighted similarity between each video frame and the adjacent frames:
[0024] S=α·D+β·D1+γ·D2
[0025] Among them, S is the weighted similarity between each video frame and the adjacent frame; α is the color feature similarity weight; β is the fish body shape feature similarity weight; γ is the depth feature similarity weight; D is the color feature similarity matrix; D1 is the fish body shape feature similarity matrix; D2 is the depth feature similarity matrix;
[0026] S207, calculating a threshold value according to the weighted similarity, and taking the adjacent frames corresponding to the video frames whose weighted similarity is greater than the threshold value as key frames to obtain a key frame set; the expression of the threshold value is:
[0027]
[0028] in, is the threshold; E is the total number of video frames; x is the video frame number; S(x+1,x) is the weighted similarity between the xth video frame and the adjacent frames; τ is the adaptive adjustment factor of the threshold;
[0029] S208, using the YOLOv5 neural network model to obtain the number and position of fish in each key frame in the key frame set, and obtain the fish detection result.
[0030] The beneficial effects of the above further scheme are as follows: the present invention extracts key frames from fish school images based on color feature similarity, fish body shape feature similarity and depth feature similarity, and performs fishway fish passing data analysis based on key frames, which can improve efficiency; in the process of calculating color feature similarity, a color quantization histogram is used to remove brightness interference and jitter problems in video frames due to lighting changes, reduce lighting differences in fishway images due to underwater monitoring, and improve the accuracy of fishway fish passing data monitoring; at the same time, in the process of calculating fish body shape feature similarity, image enhancement processing is performed on the video frames to eliminate uneven brightness, and the enhanced image obtained has stronger detail expression; the obtained fish body shape feature vector contains more information; and the video frame is divided into several small blocks, and the image block features of each image block are calculated separately, which reduces mutual interference of image scene information.
[0031] Furthermore, the step S203 is specifically as follows:
[0032] S2031. Perform color feature extraction based on the fish school video sequence to obtain a color feature vector graph of each video frame:
[0033] Q1(x)=H(x)P s P v +P v S(x)+V(x)
[0034] Where Q1(x) is the color feature vector of the xth video frame in the fish school video sequence; x is the video frame number; P s is the quantization factor of the S channel; P v is the quantization factor of the V channel; H(x) is the hue channel of the x-th video frame; S(x) is the saturation channel of the x-th video frame; V(x) is the brightness channel of the x-th video frame;
[0035] S2032, perform color quantization according to the color feature vector map of each video frame to obtain a color quantization histogram of each video frame:
[0036] H x =[λ(x1),λ(x2),λ(x3),...,λ(x n )]
[0037]
[0038]
[0039] Among them, H x is the color quantization histogram of the x-th video frame; λ(x n ) is the color value of the pixel in the xth video frame x n The global probability of n is the total number of pixel color values; λ(x j ) is the color value of the pixel in the xth video frame x j The global probability of; c is the color value of the pixel; x j is the jth color value in the xth video frame; j is the pixel color value number; h(x j ) is the color value of the pixel in the xth video frame x j The single probability of; N is the total number of pixels in the x-th video frame; i is the pixel number; δ i (x j ) is used to determine whether the color value of the i-th pixel is x j 0-1 indicator function of;
[0040] S2033, calculating the color feature similarity between each video frame and the adjacent frames according to the color quantization histogram of each video frame and the adjacent frame sequence:
[0041]
[0042] Among them, D x is the color feature similarity between the xth video frame and the adjacent frames; Hx is the color quantization histogram of the xth video frame; H x+1 is the color quantization histogram of the x+1th video frame; |·| is the absolute value function.
[0043] The beneficial effects of the above further scheme are as follows: the color quantization histogram can remove the brightness interference and jitter problems in the video frame caused by the change of illumination, and the color feature similarity is calculated based on this, and key frames are extracted according to the color feature similarity, which can reduce the illumination difference of the fishway image caused by underwater monitoring and improve the accuracy of the fishway passing data monitoring.
[0044] Furthermore, the step S204 is specifically as follows:
[0045] S2041, performing image enhancement processing on each video frame in the fish school video sequence to obtain an enhanced image of each video frame:
[0046] F(y)=RGB([(L-1)P(x')+0.5])
[0047]
[0048]
[0049] Wherein, F(y) is the enhanced image mapping function of the x-th video frame in the fish school video sequence; y is the enhanced image of the x-th video frame; RGB(·) is the function of merging and converting the YUV channel components into the RGB image; L is the total number of Y channel component values; P(x') is the cumulative grayscale probability based on the Y channel component after the x-th video frame in the fish school video sequence is mapped to the YUV channel; x' is the Y channel component of the x-th video frame mapped to the YUV channel; c' is the Y channel component value; x' j' is the j'th value of the Y channel component in the xth video frame; Y(x') is the gray level probability based on the Y channel component after the xth video frame in the fish school video sequence is mapped to the YUV channel; N is the total number of pixels in the xth video frame; i is the pixel number; σ i (x' j' ) is used to determine whether the Y channel component of the i-th pixel is x' j' 0-1 indicator function; j' is the number of the Y channel component value;
[0050] S2042, according to the enhanced image of each video frame, respectively calculate the horizontal gradient and the vertical gradient of the pixel point in each video frame:
[0051] G x,X (m,n)=y x (m+1,n)-y x (m-1,n)
[0052] G x,Y (m,n)=y x (m,n+1)-y x (m,n-1)
[0053] Among them, G x,X (m,n) is the horizontal gradient of the pixel (m,n) in the xth video frame; G x,Y (m,n) is the vertical gradient of the pixel point (m,n) in the x-th video frame; m is the horizontal coordinate of the pixel point in the x-th video frame; n is the vertical coordinate of the pixel point in the x-th video frame; y x (m+1,n) is the value of the pixel at the m+1th row and nth column in the grayscale image of the enhanced image of the xth video frame; y x (·) is the pixel value function of the grayscale image of the enhanced image of the x-th video frame;
[0054] S2043, according to the horizontal direction gradient and the vertical direction gradient of the pixel points in each video frame, respectively calculate the gradient amplitude and the gradient direction of the pixel points in each video frame:
[0055]
[0056]
[0057] Among them, g x (m,n) is the gradient amplitude of the pixel (m,n) in the xth video frame; η x (m,n) is the gradient direction of the pixel (m,n) in the x-th video frame; arctan(·) is the inverse tangent function;
[0058] S2044, cutting each video frame into a plurality of cells, and obtaining image blocks of each video frame respectively;
[0059] S2045, performing statistical analysis on the image blocks of each video frame according to the gradient amplitude and gradient direction of the pixel points of each video frame to obtain histogram information of each image block in each video;
[0060] S2046. According to the histogram information of each image block in each video, each image block of each video frame is respectively normalized within the block to obtain the image block features of each image block in each video frame:
[0061]
[0062] Among them, f x,t is the image block feature of the t-th image block in the x-th video frame; t is the image block number; v is the unnormalized amount of histogram information of the t-th image block in the x-th video frame; ||·||2 is the L2 norm; ε is a constant;
[0063] S2047, combining the image block features of each video frame respectively to obtain a fish body shape feature vector of each video frame;
[0064] S2048. Calculate the fish body shape feature similarity between each video frame and an adjacent frame according to the fish body shape feature vector of each video frame:
[0065]
[0066] Among them, D 1,x is the similarity of fish body shape features between the xth video frame and the adjacent frames.
[0067] The beneficial effects of the above further scheme are: by performing image enhancement processing on the video frames, uneven lighting can be eliminated, and the obtained enhanced image has stronger detail expression; the obtained fish body shape feature vector contains more information; and the video frames are divided into several small blocks, and the image block features of each image block are calculated separately, thereby reducing the mutual interference of image scene information.
[0068] Furthermore, the step S3 specifically comprises taking the key frame where the number of fish changes as the starting frame of the fish school image segment according to the fish detection result, and taking the frame before the next key frame where the number of fish changes as the ending frame of the fish school image segment, to obtain several fish school image segments.
[0069] The beneficial effect of the above further solution is that the fish school image is segmented according to the number of fish bodies, which can improve the calculation speed while retaining the fish passing characteristics of the fishway.
[0070] Furthermore, the step S5 is specifically as follows:
[0071] S501, obtaining the movement trajectory of each fish in each fish school image segment according to the fish tracking result;
[0072] S502, obtaining the fish body data located at the video frame boundary in the first frame and the last frame of each fish school image segment according to the movement trajectory of each fish body in each fish school image segment;
[0073] S503, splicing the fish body data located at the video frame boundary in the first frame and the last frame of each fish school image segment in a time sequence to obtain a complete fish body motion trajectory of the fish school image;
[0074] S504, obtaining the trajectory appearance time and trajectory disappearance time of each fish body according to the complete fish body motion trajectory of the fish school image;
[0075] S505, obtaining the fish body trajectory at the boundary of the fish school image according to the complete fish body motion trajectory of the fish school image;
[0076] S506, calculating the number of fish passing through the fishway according to the fish body trajectories at the boundary of the fish school image screen;
[0077] S507, obtaining a monitoring result of fish passing through the fishway according to the appearance time and disappearance time of the track of each fish body and the number of fish passing through the fishway.
[0078] The beneficial effects of the above further scheme are: through the fish body data located at the boundary of the video frame in the first frame and the last frame of each fish school image segment, the characteristics of the fish body leaving the picture can be described more simply and quickly; by splicing the fish body data of each fish school image segment based on the boundary of the video frame, the fish body movement trajectory of the entire fish school image can be better drawn, thereby obtaining the fish passing data of the entire fish school image. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] Figure 1 It is a system structure diagram of the present invention.
[0080] Figure 2 The present invention is a flow chart of the method. DETAILED DESCRIPTION
[0081] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0082] Example 1
[0083] like Figure 1 As shown, a fish intelligent monitoring system provided by the present invention includes a data acquisition module, a fish body recognition module, a target tracking module and a trajectory discrimination module;
[0084] The data acquisition module is used to acquire images of fish schools in the river section;
[0085] The fish body recognition module is used to recognize fish bodies in the fish school image and obtain fish body detection results;
[0086] The target tracking module is used to track the fish body using the SORT algorithm according to the fish school image and the fish body detection result to obtain the fish body tracking result;
[0087] The trajectory identification module is used to calculate the amount of fish passing through the fishway and obtain the fish passing time according to the fish body tracking result, so as to obtain the fish passing monitoring result of the fishway.
[0088] Example 2
[0089] like Figure 2As shown, in one embodiment of the present invention, a fish intelligent monitoring method comprises the following steps:
[0090] S1, obtaining fish school images in the river section;
[0091] S2, obtaining key frames of the fish school image, and performing target detection on the key frames of the fish school image to obtain fish body detection results;
[0092] S3, cutting the fish school image according to the fish body detection result to obtain a number of fish school image segments;
[0093] S4, tracking the fish body according to the image fragments of each fish school, and obtaining the fish body tracking result by using the SORT algorithm;
[0094] S5. According to the fish body tracking result, track identification is performed to obtain the fish passage fish monitoring result.
[0095] The step S2 is specifically as follows:
[0096] S201, obtaining a fish school video sequence according to the fish school image;
[0097] S202, obtaining adjacent frames of each video frame in the fish school video sequence to obtain an adjacent frame sequence;
[0098] S203, performing color feature extraction and similarity calculation based on the fish school video sequence and the adjacent frame sequence, and obtaining the color feature similarity between each video frame and the adjacent frame;
[0099] S204, extracting fish body shape features and calculating similarity based on the fish school video sequence and the adjacent frame sequence, and obtaining the fish body shape feature similarity between each video frame and the adjacent frame;
[0100] S205, according to the fish school video sequence and the adjacent frame sequence, using the Alex-Net convolutional neural network model and the Hamming distance to respectively perform deep feature extraction and similarity calculation to obtain the deep feature similarity between each video frame and the adjacent frames;
[0101] S206, according to the color feature similarity between each video frame and the adjacent frames, the fish body shape feature similarity between each video frame and the adjacent frames, and the depth feature similarity between each video frame and the adjacent frames, respectively obtain the weighted similarity between each video frame and the adjacent frames:
[0102] S=α·D+β·D1+γ·D2
[0103] Among them, S is the weighted similarity between each video frame and the adjacent frame; α is the color feature similarity weight; β is the fish body shape feature similarity weight; γ is the depth feature similarity weight; D is the color feature similarity matrix; D1 is the fish body shape feature similarity matrix; D2 is the depth feature similarity matrix;
[0104] S207, calculating a threshold value according to the weighted similarity, and taking the adjacent frames corresponding to the video frames whose weighted similarity is greater than the threshold value as key frames to obtain a key frame set; the expression of the threshold value is:
[0105]
[0106] in, is the threshold; E is the total number of video frames; x is the video frame number; S(x+1,x) is the weighted similarity between the xth video frame and the adjacent frames; τ is the adaptive adjustment factor of the threshold;
[0107] S208, using the YOLOv5 neural network model to obtain the number and position of fish in each key frame in the key frame set, and obtain the fish detection result.
[0108] The step S203 is specifically as follows:
[0109] S2031. Perform color feature extraction based on the fish school video sequence to obtain a color feature vector graph of each video frame:
[0110] Q1(x)=H(x)P s P v +P v S(x)+V(x)
[0111] Where Q1(x) is the color feature vector of the xth video frame in the fish school video sequence; x is the video frame number; P s is the quantization factor of the S channel; P v is the quantization factor of the V channel; H(x) is the hue channel of the x-th video frame; S(x) is the saturation channel of the x-th video frame; V(x) is the brightness channel of the x-th video frame;
[0112] S2032, perform color quantization according to the color feature vector map of each video frame to obtain a color quantization histogram of each video frame:
[0113] H x =[λ(x1),λ(x2),λ(x3),...,λ(x n )]
[0114]
[0115]
[0116] Among them, H x is the color quantization histogram of the x-th video frame; λ(x n ) is the color value of the pixel in the xth video frame x n The global probability of n is the total number of pixel color values; λ(x j ) is the color value of the pixel in the xth video frame x j The global probability of; c is the color value of the pixel; x j is the jth color value in the xth video frame; j is the pixel color value number; h(x j ) is the color value of the pixel in the xth video frame x j The single probability of; N is the total number of pixels in the x-th video frame; i is the pixel number; δ i (x j ) is used to determine whether the color value of the i-th pixel is x j 0-1 indicator function of;
[0117] S2033, calculating the color feature similarity between each video frame and the adjacent frames according to the color quantization histogram of each video frame and the adjacent frame sequence:
[0118]
[0119] Among them, D x is the color feature similarity between the xth video frame and the adjacent frames; H x is the color quantization histogram of the xth video frame; H x+1 is the color quantization histogram of the x+1th video frame; |·| is the absolute value function.
[0120] The step S204 is specifically as follows:
[0121] S2041, performing image enhancement processing on each video frame in the fish school video sequence to obtain an enhanced image of each video frame:
[0122] F(y)=RGB([(L-1)P(x')+0.5])
[0123]
[0124]
[0125] Wherein, F(y) is the enhanced image mapping function of the x-th video frame in the fish school video sequence; y is the enhanced image of the x-th video frame; RGB(·) is the function of merging and converting the YUV channel components into the RGB image; L is the total number of Y channel component values; P(x') is the cumulative grayscale probability based on the Y channel component after the x-th video frame in the fish school video sequence is mapped to the YUV channel; x' is the Y channel component of the x-th video frame mapped to the YUV channel; c' is the Y channel component value; x' j' is the j'th value of the Y channel component in the xth video frame; Y(x') is the gray level probability based on the Y channel component after the xth video frame in the fish school video sequence is mapped to the YUV channel; N is the total number of pixels in the xth video frame; i is the pixel number; σ i (x' j' ) is used to determine whether the Y channel component of the i-th pixel is x' j' 0-1 indicator function; j' is the number of the Y channel component value;
[0126] S2042, according to the enhanced image of each video frame, respectively calculate the horizontal gradient and the vertical gradient of the pixel point in each video frame:
[0127] G x,X (m,n)=y x (m+1,n)-y x (m-1,n)
[0128] G x,Y (m,n)=y x (m,n+1)-y x (m,n-1)
[0129] Among them, G x,X (m,n) is the horizontal gradient of the pixel (m,n) in the xth video frame; G x,Y (m,n) is the vertical gradient of the pixel point (m,n) in the x-th video frame; m is the horizontal coordinate of the pixel point in the x-th video frame; n is the vertical coordinate of the pixel point in the x-th video frame; y x (m+1,n) is the value of the pixel at the m+1th row and nth column in the grayscale image of the enhanced image of the xth video frame; y x (·) is the pixel value function of the grayscale image of the enhanced image of the x-th video frame;
[0130] S2043, according to the horizontal direction gradient and the vertical direction gradient of the pixel points in each video frame, respectively calculate the gradient amplitude and the gradient direction of the pixel points in each video frame:
[0131]
[0132]
[0133] Among them, g x (m,n) is the gradient amplitude of the pixel (m,n) in the xth video frame; η x (m,n) is the gradient direction of the pixel (m,n) in the x-th video frame; arctan(·) is the inverse tangent function;
[0134] S2044, cutting each video frame into a plurality of cells, and obtaining image blocks of each video frame respectively;
[0135] S2045, performing statistical analysis on the image blocks of each video frame according to the gradient amplitude and gradient direction of the pixel points of each video frame to obtain histogram information of each image block in each video;
[0136] S2046. According to the histogram information of each image block in each video, each image block of each video frame is respectively normalized within the block to obtain the image block features of each image block in each video frame:
[0137]
[0138] Among them, f x,t is the image block feature of the t-th image block in the x-th video frame; t is the image block number; v is the unnormalized amount of histogram information of the t-th image block in the x-th video frame; ||·||2 is the L2 norm; ε is a constant;
[0139] S2047, combining the image block features of each video frame respectively to obtain a fish body shape feature vector of each video frame;
[0140] S2048. Calculate the fish body shape feature similarity between each video frame and an adjacent frame according to the fish body shape feature vector of each video frame:
[0141]
[0142] Among them, D 1,x is the similarity of fish body shape features between the xth video frame and the adjacent frames.
[0143] The step S3 specifically comprises taking the key frame where the number of fish changes as the starting frame of the fish school image segment according to the fish body detection result, and taking the frame before the key frame where the number of fish changes next time as the ending frame of the fish school image segment, to obtain a plurality of fish school image segments.
[0144] The step S5 is specifically as follows:
[0145] S501, obtaining the movement trajectory of each fish in each fish school image segment according to the fish tracking result;
[0146] S502, obtaining the fish body data located at the video frame boundary in the first frame and the last frame of each fish school image segment according to the movement trajectory of each fish body in each fish school image segment;
[0147] S503, splicing the fish body data located at the video frame boundary in the first frame and the last frame of each fish school image segment in a time sequence to obtain a complete fish body motion trajectory of the fish school image;
[0148] S504, obtaining the trajectory appearance time and trajectory disappearance time of each fish body according to the complete fish body motion trajectory of the fish school image;
[0149] S505, obtaining the fish body trajectory at the boundary of the fish school image according to the complete fish body motion trajectory of the fish school image;
[0150] S506, calculating the number of fish passing through the fishway according to the fish body trajectories at the boundary of the fish school image screen;
[0151] S507, obtaining a monitoring result of fish passing through the fishway according to the appearance time and disappearance time of the track of each fish body and the number of fish passing through the fishway.
Claims
1. A fish intelligent monitoring method for executing a fish intelligent monitoring system, wherein the fish intelligent monitoring system comprises a data acquisition module, a fish body recognition module, a target tracking module and a trajectory discrimination module; The data acquisition module is used to acquire images of fish schools in the river section; The fish body recognition module is used to recognize fish bodies in the fish school image and obtain fish body detection results; The target tracking module is used to track the fish body using the SORT algorithm according to the fish school image and the fish body detection result to obtain the fish body tracking result; The trajectory identification module is used to calculate the amount of fish passing through the fishway and obtain the time of fish passing according to the fish body tracking results, and obtain the fish passing monitoring results of the fishway, and is characterized in that: The following steps are involved: S1, obtaining fish school images in the river section; S2, obtaining key frames of the fish school image, and performing target detection on the key frames of the fish school image to obtain fish body detection results; the step S2 is specifically as follows: S201, obtaining a fish school video sequence according to the fish school image; S202, obtaining adjacent frames of each video frame in the fish school video sequence to obtain an adjacent frame sequence; S203, performing color feature extraction and similarity calculation based on the fish school video sequence and the adjacent frame sequence, and obtaining the color feature similarity between each video frame and the adjacent frame; S204, extracting fish body shape features and calculating similarity based on the fish school video sequence and the adjacent frame sequence, and obtaining the fish body shape feature similarity between each video frame and the adjacent frame; S205, according to the fish school video sequence and the adjacent frame sequence, using the Alex-Net convolutional neural network model and the Hamming distance to respectively perform deep feature extraction and similarity calculation to obtain the deep feature similarity between each video frame and the adjacent frames; S206, according to the color feature similarity between each video frame and the adjacent frames, the fish body shape feature similarity between each video frame and the adjacent frames, and the depth feature similarity between each video frame and the adjacent frames, respectively obtain the weighted similarity between each video frame and the adjacent frames: S=α·D+β·D1+γ·D2 Among them, S is the weighted similarity between each video frame and the adjacent frame; α is the color feature similarity weight; β is the fish body shape feature similarity weight; γ is the depth feature similarity weight; D is the color feature similarity matrix; D1 is the fish body shape feature similarity matrix; D2 is the depth feature similarity matrix; S207, calculating a threshold value according to the weighted similarity, and taking the adjacent frames corresponding to the video frames whose weighted similarity is greater than the threshold value as key frames to obtain a key frame set; the expression of the threshold value is: in, is the threshold; E is the total number of video frames; x is the video frame number; S(x+1,x) is the weighted similarity between the xth video frame and the adjacent frames; τ is the adaptive adjustment factor of the threshold; S208, using the YOLOv5 neural network model to obtain the number and position of fish in each key frame in the key frame set, and obtain a fish detection result; S3, according to the fish body detection result, the fish school image is cut to obtain a plurality of fish school image segments; the step S3 specifically comprises, according to the fish body detection result, taking the key frame in which the number of fish bodies changes as the starting frame of the fish school image segment, and taking the frame before the next key frame in which the number of fish bodies changes as the ending frame of the fish school image segment, to obtain a plurality of fish school image segments; S4, tracking the fish body according to the image fragments of each fish school, and obtaining the fish body tracking result by using the SORT algorithm; S5, according to the fish body tracking result, track identification is performed to obtain the fish passage fish monitoring result; the step S5 is specifically as follows: S501, obtaining the movement trajectory of each fish in each fish school image segment according to the fish tracking result; S502, obtaining the fish body data located at the video frame boundary in the first frame and the last frame of each fish school image segment according to the movement trajectory of each fish body in each fish school image segment; S503, splicing the fish body data located at the video frame boundary in the first frame and the last frame of each fish school image segment in a time sequence to obtain a complete fish body motion trajectory of the fish school image; S504, obtaining the trajectory appearance time and trajectory disappearance time of each fish body according to the complete fish body motion trajectory of the fish school image; S505, obtaining the fish body trajectory at the boundary of the fish school image according to the complete fish body motion trajectory of the fish school image; S506, calculating the number of fish passing through the fishway according to the fish body trajectories at the boundary of the fish school image screen; S507, obtaining a monitoring result of fish passing through the fishway according to the appearance time and disappearance time of the track of each fish body and the number of fish passing through the fishway.
2. The intelligent fish monitoring method according to claim 1, characterized in that: The step S203 is specifically as follows: S2031. Perform color feature extraction based on the fish school video sequence to obtain a color feature vector graph of each video frame: Q1(x)=H(x)P s P v +P v S(x)+V(x) Where Q1(x) is the color feature vector of the xth video frame in the fish school video sequence; x is the video frame number; P s is the quantization factor of the S channel; P v is the quantization factor of the V channel; H(x) is the hue channel of the x-th video frame; S(x) is the saturation channel of the x-th video frame; V(x) is the brightness channel of the x-th video frame; S2032, perform color quantization according to the color feature vector map of each video frame to obtain a color quantization histogram of each video frame: H x =[λ(x1),λ(x2),λ(x3),...,λ(x n )] Among them, H x is the color quantization histogram of the x-th video frame; λ(x n ) is the color value of the pixel in the xth video frame x n The global probability of n is the total number of pixel color values; λ(x j ) is the color value of the pixel in the xth video frame x j The global probability of; c is the color value of the pixel; x j is the jth color value in the xth video frame; j is the pixel color value number; h(x j ) is the color value of the pixel in the xth video frame x j The single probability of; N is the total number of pixels in the x-th video frame; i is the pixel number; δ i (x j ) is used to determine whether the color value of the i-th pixel is x j 0-1 indicator function of; S2033, calculating the color feature similarity between each video frame and the adjacent frames according to the color quantization histogram of each video frame and the adjacent frame sequence: Among them, D x is the color feature similarity between the xth video frame and the adjacent frames; H x is the color quantization histogram of the xth video frame; H x+1 is the color quantization histogram of the x+1th video frame; |·| is the absolute value function.
3. The intelligent fish monitoring method according to claim 1, characterized in that: The step S204 is specifically as follows: S2041, performing image enhancement processing on each video frame in the fish school video sequence to obtain an enhanced image of each video frame: F(y)=RGB([(L-1)P(x')+0.5]) Wherein, F(y) is the enhanced image mapping function of the x-th video frame in the fish school video sequence; y is the enhanced image of the x-th video frame; RGB(·) is the function of merging and converting the YUV channel components into the RGB image; L is the total number of Y channel component values; P(x') is the cumulative grayscale probability based on the Y channel component after the x-th video frame in the fish school video sequence is mapped to the YUV channel; x' is the Y channel component of the x-th video frame mapped to the YUV channel; c' is the Y channel component value; x' j' is the j'th value of the Y channel component in the xth video frame; Y(x') is the gray level probability based on the Y channel component after the xth video frame in the fish school video sequence is mapped to the YUV channel; N is the total number of pixels in the xth video frame; i is the pixel number; σ i (x' j' ) is used to determine whether the Y channel component of the i-th pixel is x' j' 0-1 indicator function; j' is the number of the Y channel component value; S2042, according to the enhanced image of each video frame, respectively calculate the horizontal gradient and the vertical gradient of the pixel point in each video frame: G x,X (m,n)=y x (m+1,n)-y x (m-1,n) G x,Y (m,n)=y x (m,n+1)-y x (m,n-1) Among them, G x,X (m,n) is the horizontal gradient of the pixel (m,n) in the xth video frame; G x,Y (m,n) is the vertical gradient of the pixel point (m,n) in the x-th video frame; m is the horizontal coordinate of the pixel point in the x-th video frame; n is the vertical coordinate of the pixel point in the x-th video frame; y x (m+1,n) is the value of the pixel at the m+1th row and nth column in the grayscale image of the enhanced image of the xth video frame; y x (·) is the pixel value function of the grayscale image of the enhanced image of the x-th video frame; S2043, according to the horizontal direction gradient and the vertical direction gradient of the pixel points in each video frame, respectively calculate the gradient amplitude and the gradient direction of the pixel points in each video frame: Among them, g x (m,n) is the gradient amplitude of the pixel (m,n) in the xth video frame; η x (m,n) is the gradient direction of the pixel (m,n) in the x-th video frame; arctan(·) is the inverse tangent function; S2044, cutting each video frame into a plurality of cells, and obtaining image blocks of each video frame respectively; S2045, performing statistical analysis on the image blocks of each video frame according to the gradient amplitude and gradient direction of the pixel points of each video frame to obtain histogram information of each image block in each video; S2046. According to the histogram information of each image block in each video, each image block of each video frame is respectively normalized within the block to obtain the image block features of each image block in each video frame: Among them, f x,t is the image block feature of the t-th image block in the x-th video frame; t is the image block number; v is the unnormalized amount of histogram information of the t-th image block in the x-th video frame; ||·||2 is the L2 norm; ε is a constant; S2047, combining the image block features of each video frame respectively to obtain a fish body shape feature vector of each video frame; S2048. Calculate the fish body shape feature similarity between each video frame and an adjacent frame according to the fish body shape feature vector of each video frame: Among them, D 1,x is the similarity of fish body shape features between the xth video frame and the adjacent frames; f x is the fish body shape feature vector of the xth video frame; f x+1 is the fish body shape feature vector of the adjacent frame.
Citation Information
Patent Citations
Video moving object tracking method based on cumulative histogram particle filtering
CN102184548A
Fish passing fishway system and method for dynamically identifying and tracking number and variety of fishes
CN114049477A
Parallel acceleration and dynamic scheduling implementation method based on monitoring camera AI algorithm
CN116863408A