Fish swimming posture detection method, device, electronic equipment and storage medium

By setting up an infrared camera device and a target detection model on the water surface, identifying the main body of the fish and fitting the fish posture ellipse, the problem of low accuracy of fish swimming posture detection in the existing technology is solved, and accurate fish posture is achieved detection.

CN117809331BActive Publication Date: 2024-08-16SOUTH CHINA SEA FISHERIES RES INST CHINESE ACAD OF FISHERY SCI +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311555169.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-20
Publication Date
2024-08-16
Estimated Expiration
2043-11-20

AI Technical Summary

Technical Problem

The detection accuracy of existing fish swimming posture detection methods is low. This is mainly due to the small field of view of the underwater camera device, poor visibility, and large impact from the attachment of fouling organisms. As a result, the acquired video of fish activity is unclear and difficult to be accurate. Detect fish body posture.

Method used

An infrared camera device set on the water surface is used to obtain fish activity videos, and individual fish are identified through the target detection model, the main body of the fish is determined, and the fish body posture ellipse is fitted according to the main body of the fish body to achieve accurate detection of the swimming posture of the fish body. .

Benefits of technology

Through clear identification and processing of fish activity videos, the fish posture ellipse is accurately determined, which improves the accuracy of fish swimming posture detection and ensures the accuracy of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117809331B
    Figure CN117809331B
Patent Text Reader

Abstract

The present application relates to a method, device, electronic device and storage medium for detecting the swimming posture of a fish body, the method comprising: obtaining a video of fish activity by an infrared camera device arranged on the water surface, the video of fish activity containing multiple images of fish school activity, the image of fish school activity being an image of at least one individual fish; identifying the individual fish contained in the image of the fish school activity, obtaining an individual fish image annotation data set; processing the individual fish image, determining the body of the individual fish in the individual fish image; determining the body posture ellipse of the individual fish according to the body of the fish, and completing the swimming posture detection of the individual fish according to the body posture ellipse in two consecutive frames of the fish school activity image. The technical solution provided by the present application effectively improves the detection accuracy of the fish body swimming posture detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of fish farming, and in particular to a method, device, electronic equipment and storage medium for detecting the swimming posture of a fish. Background Art

[0002] In some practical application scenarios, it is necessary to determine the swimming posture of fish when breeding fish in deep-sea cages. At present, the existing technology uses an underwater camera to obtain a video of the activity of a school of fish, and then uses a correlation analysis algorithm to detect the swimming posture of the fish in the school of fish.

[0003] However, underwater video cameras have disadvantages such as small field of view, poor visibility, and great influence of fouling organisms, making it difficult to obtain effective videos of fish activities. As a result, the detection accuracy of existing fish swimming posture detection methods is low. Summary of the invention

[0004] The present application provides a method, device, electronic device and storage medium for detecting the swimming posture of a fish, so as to improve the detection accuracy of the swimming posture detection of a fish.

[0005] In a first aspect, the present application provides a method for detecting a swimming posture of a fish, the method comprising:

[0006] Acquire a fish activity video by using an infrared camera device disposed on the water surface, wherein the fish activity video includes a plurality of fish activity images, and the fish activity image is an image of at least one individual fish;

[0007] Identifying the individual fish contained in the fish school activity image to obtain individual fish images of the individual fish;

[0008] Processing the individual fish image to determine the body of the individual fish in the individual fish image;

[0009] The fish body posture ellipse of the individual fish is determined according to the fish body, and the swimming posture detection of the individual fish contained in an image of the fish school activity is completed.

[0010] In a second aspect, the present application provides a device for detecting a swimming posture of a fish, the device comprising:

[0011] An acquisition module, used to acquire fish activity videos through an infrared camera device arranged on the water surface, wherein the fish activity videos contain a plurality of fish activity images, and the fish activity images are images of at least one individual fish;

[0012] An identification module, used for identifying the individual fish contained in the fish school activity image, and obtaining the individual fish image of the individual fish;

[0013] A processing module, used for processing the individual fish image to determine the body of the individual fish in the individual fish image;

[0014] A determination module is used to determine the fish posture ellipse of the individual fish according to the fish body, and complete the swimming posture detection of the individual fish according to the fish posture ellipse in two consecutive frames of the fish school activity image.

[0015] In a third aspect, the present application provides an electronic device comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to execute the method described in the first aspect above.

[0016] In a fourth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the method described in the first aspect above.

[0017] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, by shooting a video with an infrared camera device set on the water surface, obtains a clear video of fish activity, and provides effective data support for the subsequent detection of the swimming posture of the fish body. At the same time, the obtained fish activity video is analyzed, the body of the individual fish is identified in the fish activity video, the body posture ellipse of the individual fish is determined based on the body of the individual fish, and the swimming posture of the individual fish is determined based on the shape of the body posture ellipse, thereby realizing the accurate detection of the swimming posture of the fish body and ensuring the accuracy of the detection of the swimming posture of the fish body. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0020] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0021] Figure 1 A flow chart of a method for detecting the swimming posture of a fish provided in an embodiment of the present application.

[0022] Figure 2 A model architecture diagram of a target detection model in a method for detecting a fish swimming posture provided in an embodiment of the present application.

[0023] Figure 3 A schematic diagram of the process of determining the body of an individual fish in an individual fish image in a method for detecting the swimming posture of a fish provided in an embodiment of the present application.

[0024] Figure 4 An overall flow chart of a method for detecting the swimming posture of a fish provided in an embodiment of the present application.

[0025] Figure 5 A schematic diagram of the structure of a device for detecting the swimming posture of a fish provided in an embodiment of the present application.

[0026] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0028] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0029] In order to solve the technical problem of low detection accuracy of existing methods for detecting the swimming posture of fish, the present application provides a method for detecting the swimming posture of fish to improve the accuracy of detecting the swimming posture of fish.

[0030] Figure 1 A flow chart of a method for detecting the swimming posture of a fish provided in an embodiment of the present application is shown in FIG. Figure 1 , the method comprises the following steps:

[0031] S101: Obtaining fish activity videos through an infrared camera device set on the water surface;

[0032] Specifically, the camera device is arranged above the water surface of the net cage. The camera device can be an infrared camera, which can shoot the fish school under the water surface under various ambient lighting conditions to obtain clear fish activity videos of the fish school. One or more camera devices can be provided, and by providing multiple camera devices, fish activity videos can be shot from multiple different angles.

[0033] The fish activity video includes multiple frames of continuous images arranged in time series, and the multiple frames of images include fish school activity images, which are images containing at least one individual fish.

[0034] S102: Identify individual fish included in the fish school activity image to obtain individual fish images of the individual fish;

[0035] Specifically, individual fish in the fish school activity image are identified through a preset target detection model, and an individual fish image of each individual fish included in the fish school activity image is obtained based on the identification result.

[0036] The target detection model is a trained neural network model. In a feasible embodiment of the present application, the target detection model may specifically be Faster-RCNN (Faster-Region based Convolutional Neural Network, a faster region-based convolutional neural network).

[0037] In another feasible embodiment of the present application, FPN (feature pyramid networks) is used to improve Faster-RCNN, and the improved FPN-faster-RCNN is used as the target detection model. The specific network architecture of FPN-faster-RCNN is as follows Figure 2 As shown, the network architecture can be adaptively improved by those skilled in the art according to actual application scenarios. Figure 2 The architecture shown is only an example and will not be described in detail here.

[0038] Before segmenting the fish school activity image, the target detection model has been trained with a labeled data set and can identify individual fish contained in the fish school activity image and output individual fish images of each individual fish contained in the fish school activity image based on the recognition results, wherein the labeled data set consists of multiple fish school activity images in which individual fish have been manually labeled.

[0039] In a feasible embodiment of the present application, for an input image of a school of fish activity, a target detection network will identify individual fish contained in the image of the school of fish activity, and generate a target detection frame to select the identified individual fish; after completing the selection of the individual fish, the image of the individual fish surrounded by the target detection frame is cropped out from the image of the school of fish activity with the target detection frame of each individual fish as the boundary, to obtain individual fish images of the individual fish.

[0040] S103: Processing the individual fish image to determine the body of the individual fish in the individual fish image;

[0041] When determining the individual fish image, the fish activity image is cropped based on the selection range of the target detection frame to obtain the individual fish image. Since the target detection frame is a rectangle, the individual fish image not only includes the picture of the individual fish, but also includes a part of the background picture.

[0042] The individual fish images corresponding to each individual fish in the fish school activity image are processed respectively to determine the body of the individual fish in the individual fish image. Figure 3 In a feasible embodiment of the present application, the body of an individual fish is determined based on the following steps:

[0043] Determine a number of fish body cue points in the individual fish image;

[0044] Inputting individual fish images and fish body cue points of the individual fish images into a preset image segmentation model to determine candidate segmentation masks of a plurality of individual fish images;

[0045] The main body of the individual fish is determined based on each candidate segmentation mask.

[0046] Specifically, the fish body prompt points are used to simply describe the body of the individual fish in the individual fish image, and all the fish body prompt points are located on the body of the individual fish.

[0047] In a feasible embodiment of the present application, the fish body prompt point is determined based on the following steps:

[0048] Determine the pixel brightness of all pixels contained in the image of the individual fish;

[0049] Select several pixel points whose pixel brightness is higher than the set brightness threshold as fish body prompt points.

[0050] Specifically, in an individual fish image, the pixel points belonging to the main body of the individual fish are likely to have a larger pixel brightness. Therefore, fish body prompt points for simply describing the main body of the fish are selected based on the pixel brightness of the pixels in the individual fish image.

[0051] Determine the pixel brightness of all pixels contained in the individual fish image, screen all pixels by setting a brightness threshold, remove pixels whose brightness is less than the set brightness threshold, and select several pixels from pixels whose brightness is greater than the set brightness threshold as fish body prompt points.

[0052] In a feasible embodiment of the present application, the brightness threshold can be set based on the average value of the pixel brightness of all pixels contained in the individual fish image. The average value of the pixel brightness of all pixels can be calculated first, and then the brightness threshold can be set by setting the increase percentage. For example, the average value of the pixel brightness of all pixels is 100, and the increase percentage is set to 150%. At this time, the brightness threshold can be determined as 100×150%=150.

[0053] The number of selected fish body prompt points can be set by a person skilled in the art, but the number does not exceed the number of pixel points whose brightness is greater than a set brightness threshold.

[0054] The individual fish images marked with fish body prompt points are input into the preset image segmentation model, and several candidate segmentation masks of individual fish images are output. Each candidate segmentation mask represents the possible segmentation of the body of an individual fish. The candidate segmentation mask is a binary image with pixel values ​​of 0 and 1. For the individual fish image, a pixel value of 1 in the candidate segmentation mask indicates that the pixel belongs to the fish body, that is, it is predicted to be the part of the fish body; a pixel value of 0 indicates that the pixel does not belong to the fish body, that is, it is predicted to be a part other than the fish body.

[0055] The image segmentation model may be SAM (Segment Anything Model), which can output a high-quality object mask based on the input image and the prompt information (prompt point or prompt box) on the image to achieve the segmentation of a specific target on the image. The specific parameter settings of SAM can be set by those skilled in the art according to the actual situation of the individual fish image, which will not be described in detail here.

[0056] The method for determining the fish body based on the candidate segmentation mask can roughly determine the body of an individual fish, but if the body of an individual fish needs to be accurately determined, the multiple candidate segmentation masks obtained need to be further processed. Figure 3 In a feasible embodiment of the present application, multiple candidate segmentation masks are further processed to determine the body of an individual fish, including:

[0057] determining a hit matrix for an individual fish image based on each candidate segmentation mask;

[0058] Performing threshold segmentation on the individual fish images according to the hit matrix and the preset hit threshold, determining the fish body main points of the plurality of individual fish images, where the fish body main points are pixel points on the fish body main body of the individual fish;

[0059] The main body of individual fish is determined based on the main body points of the fish.

[0060] Specifically, the corresponding pixels of multiple acquired candidate segmentation masks are added together to calculate the hit matrix of the individual fish image, and the value of each pixel position represents the number of times the position is selected in the candidate segmentation mask.

[0061] After obtaining the hit matrix of the individual fish image, threshold segmentation is performed on the individual fish image based on a preset hit threshold. In a feasible embodiment of the present application, the hit threshold can be set to 50% of the maximum pixel value in the hit matrix.

[0062] In the hit matrix, pixel points corresponding to pixel values ​​greater than the hit threshold can be identified as being predicted as the main body part of an individual fish in multiple candidate segmentation masks, and the pixel points are determined as the main body points of the individual fish; in the hit matrix, pixel points corresponding to pixel values ​​less than the hit threshold can be identified as being predicted as the main body part of an individual fish in a small number of candidate segmentation masks or are not predicted as the main body part of an individual fish in the candidate segmentation masks, and the pixel points are not determined as the main body points of the individual fish.

[0063] Based on the threshold segmentation of the hit matrix, multiple main body points of the individual fish are determined. The main body points of the fish are pixel points on the main body of the individual fish. Based on the determined multiple main body points of the fish, the main body of the individual fish is determined.

[0064] S104: determining the fish posture ellipse of the individual fish according to the fish body, and completing the swimming posture detection of the individual fish according to the fish posture ellipse in two consecutive frames of fish school activity images;

[0065] Specifically, after determining the body of an individual fish, the minimum enclosing ellipse of the body is fitted based on all the body points on the body of the individual fish, and the fitted minimum enclosing ellipse is used as the body posture ellipse of the individual fish to complete the detection of the swimming posture of the individual fish.

[0066] The main body points of individual fish are all pixel points distributed on the main body of the individual fish. The minimum enclosing ellipse that can completely surround these pixel points is generated through a related fitting algorithm. In a feasible embodiment of the present application, the related fitting algorithm includes but is not limited to the least squares method, the RANSAC algorithm, the extreme point fitting algorithm, etc.

[0067] In a feasible embodiment of the present application, the minimum enclosing ellipse is fitted by the least square method. First, the pixel coordinates (x, y) of all the fish body points are determined; the pixel coordinates of each fish body point are respectively substituted into the fitting ellipse equation: Ax 2 +Bxy+Cy 2 +Dx+Ey+F=0 to obtain a group of linear equations corresponding to all the main points of the fish body; solve the group of linear equations by the linear least squares method to determine the coefficients A, B, C, D, E and F in the fitting ellipse equation; determine the fitting ellipse equation according to the determined coefficients, thereby determining the minimum enclosing ellipse of the main points of the fish body of the individual fish.

[0068] All the main points of the fish body of the individual fish are surrounded by the minimum enclosing ellipse, and the minimum enclosing ellipse of the main points of the fish body of the individual fish is used as the fish body posture ellipse of the individual fish. The fish body posture ellipse can describe the general posture of the individual fish. For example, the ellipse direction of the fish body posture ellipse is the current direction of the individual fish.

[0069] Through the technical solution provided by the above method embodiment, a clear video of fish activity is obtained by shooting a video with an infrared camera device set on the water surface, providing effective data support for subsequent detection of the swimming posture of the fish body. At the same time, the obtained fish activity video is analyzed, the body of the individual fish is identified in the fish activity video, and the body posture ellipse of the individual fish is determined based on the body of the individual fish. The swimming posture of the individual fish is determined based on the shape of the body posture ellipse, thereby realizing accurate detection of the swimming posture of the fish body and ensuring the accuracy of the detection of the swimming posture of the fish body.

[0070] Reference Figure 4 ,In a possible implementation scenario, the fish activity video is directly processed to ,complete the detection of the fish swimming posture.

[0071] Specifically, for the acquired fish activity video, the entire fish activity video is directly processed by the technical solution provided by this application. First, the fish activity video is split into multiple fish school activity images, and the fish school activity images are processed in sequence according to the time sequence of the fish activity video; the fish body posture ellipses of all individual fish in each fish school activity image are determined; all individual fish are tracked according to the fish body posture ellipses of each individual fish, and the swimming direction of each individual fish in the fish activity video is determined.

[0072] Continue to refer to Figure 4 In a feasible embodiment of the present application, all individual fish are tracked according to the fish posture ellipse of each individual fish to determine the swimming direction of each individual fish in the fish activity video, including:

[0073] The fish body posture ellipse in the first fish school activity image and the fish body posture ellipse in the second fish school activity image are processed according to the movement direction detection algorithm to determine the movement direction of the individual fish.

[0074] Specifically, the first fish school activity image and the second fish school activity image are two consecutive frames of images in the fish activity video. After the fish body posture ellipses of individual fish in the first fish school activity image and the second fish school activity image are determined, the fish body posture ellipses are matched and associated so that the fish body posture ellipse uniquely corresponds to an individual fish, thereby achieving tracking of individual fish.

[0075] For the same individual fish, its fish posture ellipse in the first fish school activity image is ellipse A, and its fish posture ellipse in the second fish school activity image is ellipse B. It can be understood that both ellipse A and ellipse B are the fish posture ellipses of the individual fish, reflecting the fish posture of the individual fish at different time nodes; match ellipse A and ellipse B through the motion direction detection algorithm, and determine the swimming direction of the individual fish in the video clip composed of the first fish school activity image and the second fish school activity image according to the ellipse direction and ellipse center distance of ellipse A and ellipse B. The motion direction detection algorithm can specifically be the Hungarian algorithm.

[0076] The above steps are repeated to process all images in the fish activity video, and the movement directions of all individual fish appearing in the fish activity video are determined, thereby achieving tracking of individual fish.

[0077] Corresponding to the above method embodiment, the present application embodiment also provides a device for detecting the swimming posture of a fish, such as Figure 5 As shown, the device may include: an acquisition module 501 , an identification module 502 , a processing module 503 and a confirmation module 504 .

[0078] An acquisition module 501 is used to acquire a fish activity video through an infrared camera device arranged on the water surface, wherein the fish activity video includes a plurality of fish activity images, and the fish activity image is an image of at least one individual fish;

[0079] The identification module 502 is used to identify individual fish included in the fish school activity image and obtain individual fish images of the individual fish;

[0080] The processing module 503 is used to process the individual fish image to determine the body of the individual fish in the individual fish image;

[0081] The determination module 504 is used to determine the fish posture ellipse of the individual fish according to the main body of the fish, and complete the swimming posture detection of the individual fish according to the fish posture ellipse in two consecutive frames of the fish school activity image.

[0082] In a possible implementation, the identification module 502 includes:

[0083] The recognition unit is used to identify individual fish contained in the fish school activity image through a preset target detection model to obtain individual fish images; the target detection model is a neural network model trained with a labeled data set, and the labeled data set consists of multiple fish school activity images after individual fish are labeled.

[0084] In a possible implementation, the processing module 503 includes:

[0085] A first determining unit is used to determine a plurality of fish body prompting points in the individual fish image;

[0086] A second determination unit is used to input the labeled individual fish images and the fish body prompt points of the individual fish images into a preset image segmentation model to determine candidate segmentation masks for a plurality of individual fish images;

[0087] The third determination unit is used to determine the body of the individual fish according to each candidate segmentation mask.

[0088] In a possible implementation manner, the second determining unit includes:

[0089] A first determination subunit is used to determine a hit matrix of an individual fish image according to each candidate segmentation mask;

[0090] The second determination subunit is used to perform threshold segmentation on the individual fish images according to the hit matrix and the preset hit threshold, and determine the fish body main points of the plurality of individual fish images, where the fish body main points are pixel points on the fish body main body of the individual fish;

[0091] The third determination subunit is used to determine the body of an individual fish according to the body points of the fish.

[0092] In a possible implementation, the first determining unit includes:

[0093] A fourth determination subunit is used to determine the pixel brightness of all pixels contained in the individual fish image;

[0094] The selection subunit is used to select a number of pixel points whose pixel brightness is higher than a set brightness threshold as fish body prompt points.

[0095] In a possible implementation, the determination module 504 includes:

[0096] The fitting unit is used to fit the minimum enclosing ellipse according to all the main points of the fish body, and determine the minimum enclosing ellipse as the fish body posture ellipse of the individual fish.

[0097] In a possible implementation, the device further includes a tracking module.

[0098] A tracking module is used to process the fish posture ellipse in the first fish school activity image and the fish posture ellipse in the second fish school activity image according to a movement direction detection algorithm to determine the movement direction of individual fish; wherein the first fish school activity image and the second fish school activity image are two consecutive frames of fish school activity images in the fish activity video.

[0099] like Figure 6 As shown, an embodiment of the present application provides an electronic device, including a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.

[0100] Memory 603, used for storing computer programs;

[0101] In one embodiment of the present application, the processor 601 is used to execute the program stored in the memory 603 to implement a method for detecting the swimming posture of a fish provided by any of the above method embodiments, for example, including:

[0102] A fish activity video is obtained by using an infrared camera device disposed on the water surface, wherein the fish activity video includes a plurality of fish school activity images, each of which is an image of at least one individual fish;

[0103] Identify individual fish contained in the fish school activity image and obtain individual fish images of the individual fish;

[0104] Processing the individual fish image to determine the body of the individual fish in the individual fish image;

[0105] The fish body posture ellipse of the individual fish is determined according to the main body of the fish, and the swimming posture detection of the individual fish is completed according to the fish body posture ellipse in two consecutive frames of the fish school activity image.

[0106] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of a method for detecting the swimming posture of a fish provided in any of the aforementioned method embodiments are implemented.

[0107] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0108] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0109] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0110] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for detecting the swimming posture of a fish, characterized in that: The method comprises: Acquire a fish activity video by using an infrared camera device disposed on the water surface, wherein the fish activity video includes a plurality of fish activity images, and the fish activity image is an image of at least one individual fish; Identifying the individual fish contained in the fish school activity image to obtain individual fish images of the individual fish; Processing the individual fish image to determine the body of the individual fish in the individual fish image; Determine the fish body posture ellipse of the individual fish according to the fish body, and complete the swimming posture detection of the individual fish according to the fish body posture ellipse in two consecutive frames of the fish school activity images; The step of processing the individual fish image to determine the body of the individual fish in the individual fish image includes: Determine a plurality of fish body prompt points in the individual fish image; wherein the fish body prompt points are a plurality of pixel points in the individual fish image whose pixel brightness is higher than a set brightness threshold; Input the individual fish image and the fish body prompt point of the individual fish image into a preset image segmentation model to determine a number of candidate segmentation masks of the individual fish image; wherein the candidate segmentation mask is a binary image, and the value of the corresponding pixel position of the candidate segmentation mask is 0 or 1, and the value of the corresponding pixel position of the candidate segmentation mask is 0, indicating that the pixel point corresponding to the pixel position does not belong to the main body of the fish body, and the value of the corresponding pixel position of the candidate segmentation mask is 1, indicating that the pixel point corresponding to the pixel position belongs to the main body of the fish body; determine the main body of the fish body of the individual fish according to each of the candidate segmentation masks; Determining the fish body of the individual fish according to the candidate segmentation mask includes: Determine a hit matrix of the individual fish image according to each of the candidate segmentation masks; wherein the values ​​of the corresponding pixel positions of each of the candidate segmentation masks are added to obtain the hit matrix of the individual fish image, and the value of each pixel position of the hit matrix represents the number of times the pixel point corresponding to the pixel position is selected in the candidate segmentation mask; Performing threshold segmentation on the individual fish images according to the hit matrix and a preset hit threshold, determining a plurality of fish body main points of the individual fish images, wherein the fish body main points are pixel points on the fish body of the individual fish; wherein the pixel point corresponding to the pixel position whose value in the hit matrix is ​​greater than the hit threshold is determined as the fish body main point; The main body of the fish body of the individual fish is determined according to the main body points of the fish body.

2. The method according to claim 1, characterized in that Identifying the individual fish contained in the fish school activity image to obtain the individual fish image of the individual fish includes: The individual fish contained in the fish school activity image are identified by a preset target detection model to obtain the individual fish image annotation data set; the target detection model is a neural network model trained with an annotation data set, and the annotation data set consists of multiple fish school activity images after individual fish annotation is completed.

3. The method according to claim 1, characterized in that Determining the fish body posture ellipse of the individual fish according to the fish body main body includes: A minimum enclosing ellipse is fitted according to all the main points of the fish body, and the minimum enclosing ellipse is determined as the fish body posture ellipse of the individual fish.

4. The method according to claim 1, characterized in that The swimming posture detection of the individual fish is completed according to the fish posture ellipse in two consecutive frames of the fish school activity image, including: The fish body posture ellipse in the first fish school activity image and the fish body posture ellipse in the second fish school activity image are processed according to a motion direction detection algorithm to determine the motion direction of the individual fish; wherein the first fish school activity image and the second fish school activity image are two consecutive frames of the fish school activity images in the fish activity video.

5. A device for detecting the swimming posture of a fish, characterized in that: The device comprises: An acquisition module, used to acquire fish activity videos through an infrared camera device arranged on the water surface, wherein the fish activity videos contain a plurality of fish activity images, and the fish activity images are images of at least one individual fish; An identification module, used for identifying the individual fish contained in the fish school activity image, and obtaining the individual fish image of the individual fish; A processing module, used for processing the individual fish image to determine the body of the individual fish in the individual fish image; A determination module, used to determine the fish body posture ellipse of the individual fish according to the fish body, and complete the swimming posture detection of the individual fish according to the fish body posture ellipse in two consecutive frames of the fish school activity image; Wherein, the processing module includes: A first determining unit is used to determine a plurality of fish body prompt points in the individual fish image; wherein the fish body prompt points are a plurality of pixel points in the individual fish image whose pixel brightness is higher than a set brightness threshold; A second determination unit is used to input the individual fish image and the fish body prompt point of the individual fish image into a preset image segmentation model to determine a plurality of candidate segmentation masks of the individual fish image; wherein the candidate segmentation mask is a binary image, and the value of the corresponding pixel position of the candidate segmentation mask is 0 or 1, and the value of the corresponding pixel position of the candidate segmentation mask is 0, indicating that the pixel point corresponding to the pixel position does not belong to the main body of the fish body, and the value of the corresponding pixel position of the candidate segmentation mask is 1, indicating that the pixel point corresponding to the pixel position belongs to the main body of the fish body; A third determining unit, configured to determine the fish body of the individual fish according to each of the candidate segmentation masks; Wherein, the second determining unit includes: A first determination subunit is used to determine a hit matrix of the individual fish image according to each of the candidate segmentation masks; wherein the hit matrix of the individual fish image is obtained by adding the values ​​of the corresponding pixel positions of each of the candidate segmentation masks, and the value of each pixel position of the hit matrix represents the number of times the pixel point corresponding to the pixel position is selected in the candidate segmentation mask; The second determination subunit is used to perform threshold segmentation on the individual fish images according to the hit matrix and a preset hit threshold, and determine a plurality of fish body main points of the individual fish images, wherein the fish body main points are pixel points on the fish body of the individual fish; wherein the pixel point corresponding to the pixel position whose value in the hit matrix is ​​greater than the hit threshold is determined as the fish body main point; The third determination subunit is used to determine the fish body main body of the individual fish according to the fish body main body points.

6. An electronic device, characterized in that: include: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor coupled to the at least one bus; At least one memory connected to the at least one bus, wherein the processor is configured to implement the method according to any one of claims 1-4.

7. A computer storage medium, characterized in that: Computer executable instructions are stored, and the computer executable instructions are used to execute the method according to any one of claims 1 to 4.

Citation Information

Cited By

  • Marine ranch net cage fish body individual monitoring system

    CN121817130A