Statistical method and computing equipment for quantity of plankton in water body sample image

By segmenting the water sample image into segmented images and using plankton recognition model to process it, the problem of instability of computing equipment during high-pixel image processing is solved, and the efficiency and accuracy of plankton count statistics are achieved.

CN119624947AInactive Publication Date: 2025-03-14CHINA NAT ENVIRONMENTAL MONITORING CENT
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510148857.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-11
Publication Date
2025-03-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When processing high-pixel-quantity water sample images, computing devices are prone to instability or even collapse due to excessive intermediate buffer storage data, and cannot guarantee the stability and efficiency of the processing.

Method used

By segmenting the water sample image into segmented images of appropriate sizes and using the plankton identification model to process the segmented images, the complete and critical identification boxes are determined, and the number of complete identification boxes and numbers is counted to determine the number of plankton based on the critical type identification box and the adjacency relationship association identification box of the critical identification box.

Benefits of technology

Through segmented image processing, the amount of data stored in the intermediate buffer of computing devices when processing a single segmented image is reduced, the stability and processing efficiency of the system are improved, and the accuracy and reliability of plankton count statistics are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119624947A_ABST
    Figure CN119624947A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a statistical method and computing equipment for the number of planktons in a water body sample image. The method for counting the number of planktons in the water body sample image comprises the following steps: obtaining segmented images and an adjacency relation of the segmented images; processing the segmented image to obtain a complete recognition frame and a critical recognition frame, and determining a critical type identifier of the critical recognition frame; for each critical recognition frame, determining a target recognition frame according to the critical type identifier, the affiliated segmented image and the adjacency relationship, and distributing a number which is the same as the selected recognition frame for the target recognition frame; and calculating the number sum of the complete identification frames and the numbers, and determining the statistical number of planktons in the water body sample image based on the number sum. Since the water body sample image is segmented into smaller segmented images and then the plankton identification processing is performed, the intermediate buffer storage data is not too large when the computing device processes the single segmented image, and the corresponding system can be stable, so that the whole processing process has better stability and high efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing, and in particular to a method and a computing device for counting the number of plankton in a water sample image. Background Art

[0002] The existing technical solution has proposed to use a deep learning model to process water sample images to realize the identification and quantitative statistics of planktonic microorganisms in water samples. In order to ensure the accuracy of the identification and quantitative statistics of the types of plankton in water bodies, the water sample images need to have a resolution level that reflects the appearance of microorganisms. In order to make the water sample images reach the resolution level that reflects the appearance of microorganisms, the existing water sample images are formed by splicing high-resolution local microscopic images collected by high-power microscopes. Since the number of pixels of the local microscopic images is very high, the number of pixels of the water sample images formed by their splicing is even higher. When a computing device deployed with a deep learning model for plankton recognition is used to process water sample images, it will cause instability or even crash due to excessive intermediate buffer storage data, and the stability and efficiency of the processing cannot be guaranteed. Summary of the invention

[0003] In order to solve the problem that computing equipment cannot stably and efficiently process water sample images with a large number of pixels, the embodiments of the present disclosure provide a new method and computing equipment for counting the number of plankton in water sample images.

[0004] In a first aspect, an embodiment of the present disclosure provides a method for counting the number of plankton in a water sample image, comprising: Segmenting the water sample image to obtain segmented images and adjacency relationships between the segmented images; Processing the segmented image using a plankton recognition model to obtain a complete recognition frame of complete plankton and a critical recognition frame of incomplete plankton in the segmented image, and determining a critical type identifier of the critical recognition frame according to a critical edge of the critical recognition frame; For each critical recognition frame, the following operations are performed: for a selected recognition frame, the adjacent segmented image is determined according to the critical type identifier, the segmented image to which it belongs, and the adjacent relationship, and a candidate recognition frame is determined according to the critical type identifier among all critical recognition frames included in the adjacent segmented image; and, according to the global coordinates of the critical edge of the selected recognition frame and the global coordinates of the critical edges of each candidate recognition frame, a target recognition frame is determined among each candidate recognition frame, and the target recognition frame is assigned the same number as that of the selected recognition frame; wherein the global coordinates are coordinates in the water body sample image, and the target recognition frame is a recognition frame having at least a preset overlap length with the selected recognition frame; Counting the number of the complete recognition frames and the number of the serial numbers; The sum of the complete identification frames and the serial numbers is obtained, and the statistical quantity of plankton in the water sample image is determined based on the sum of the numbers.

[0005] Optionally, when the critical type identifier includes a left critical identifier or a right critical identifier, determining a target recognition frame in each of the candidate recognition frames according to the global coordinates of the critical edge of the selected recognition frame and the global coordinates of the critical edges of each of the candidate recognition frames includes: Calculating the longitudinal overlap length of the global longitudinal coordinate of the longitudinal critical edge of the selected identification frame and the global longitudinal coordinate of the longitudinal critical edges of each to-be-selected identification frame; The candidate recognition frame whose longitudinal overlap length is greater than the preset overlap length is used as the target recognition frame.

[0006] Optionally, the calculating of the longitudinal overlap length of the global longitudinal coordinate of the longitudinal critical edge of the selected identification frame and the global longitudinal coordinate of the longitudinal critical edges of each to-be-selected identification frame comprises: Determine the relative positional relationship between the selected identification frame and a candidate identification frame according to the global longitudinal coordinate of the longitudinal critical edge of the selected identification frame, wherein the relative positional relationship is an upper left-lower right relationship or a lower left-upper right relationship; In the case where the relative position relationship is an upper left-lower right relationship, the difference between the ordinate of the lower end point of the longitudinal critical edge of the identification frame located at the upper left and the ordinate of the upper end point of the longitudinal critical edge of the identification frame located at the lower right is calculated as the ordinate difference; and When the relative position relationship is a lower left-lower right relationship, the difference between the ordinate of the lower end point of the longitudinal critical edge of the identification frame located at the upper right and the ordinate of the upper end point of the longitudinal critical edge of the identification frame located at the lower left is calculated as the ordinate difference; When the ordinate of the global coordinate system gradually increases from top to bottom and the ordinate difference is a positive value, the ordinate difference is used as the longitudinal overlap length; and when the ordinate of the global coordinate system gradually decreases from top to bottom and the ordinate difference is a negative value, the absolute value of the ordinate difference is used as the longitudinal overlap length.

[0007] Optionally, determining the relative positional relationship between the longitudinal critical edge of the selected identification frame and the longitudinal critical edge of a to-be-selected identification frame according to the global longitudinal coordinate of the longitudinal critical edge of the selected identification frame includes: Determine the ordinate of the midpoint of the longitudinal critical edge of the selected identification frame, and determine the ordinate of the midpoint of the longitudinal critical edge of the to-be-selected identification frame; The relative position relationship between the two is determined based on the two midpoint vertical coordinates, wherein when the midpoint vertical coordinate of the longitudinal critical edge of the identification frame on the left is located on the upper side of the midpoint vertical coordinate of the longitudinal critical edge of the to-be-selected identification frame on the right, the relative position relationship is determined to be an upper left-lower right relationship, and when the midpoint vertical coordinate of the longitudinal critical edge of the identification frame on the left is located on the lower side of the midpoint vertical coordinate of the longitudinal critical edge of the identification frame on the right, the relative position relationship is determined to be a lower left-upper right relationship.

[0008] Optionally, determining the target recognition frame in each of the candidate recognition frames according to the global coordinates of the critical edge of the selected recognition frame and the global coordinates of the critical edges of each of the candidate recognition frames further includes: Calculate the horizontal coordinate difference according to the global horizontal coordinate of the longitudinal critical edge of the to-be-selected identification frame and the global horizontal coordinates of the longitudinal critical edges of each to-be-selected identification frame; When the horizontal coordinate difference is less than a preset difference threshold, an operation of calculating the longitudinal overlap length is performed.

[0009] Optionally, when the critical type identifier includes an upper critical identifier or a lower critical identifier, determining a target recognition frame in each of the candidate recognition frames according to the global coordinates of the critical edge of the selected recognition frame and the global coordinates of the critical edges of each of the candidate recognition frames includes: Calculating the horizontal overlap length of the global horizontal coordinate of the critical edge of the selected identification frame and the global horizontal coordinate of the critical edge of each to-be-selected identification frame; The candidate recognition frame whose horizontal overlap length is greater than the preset overlap length is used as the target recognition frame.

[0010] Optionally, the calculating of the horizontal overlap length of the global horizontal coordinate of the critical edge of the selected identification frame and the global horizontal coordinate of the critical edges of each to-be-selected identification frame includes: Determine the relative position relationship between the selected identification frame critical edge and a to-be-selected identification frame critical edge according to the global horizontal coordinate of the two, wherein the relative position is an upper left-lower right relationship or a lower left-upper right relationship; In the case where the relative position relationship is an upper left-lower right relationship, calculating the difference between the abscissa of the right end point of the horizontal critical edge of the identification frame located at the upper left and the abscissa of the left end point of the horizontal critical edge of the identification frame located at the lower right as the abscissa difference; and In the case where the relative position relationship is a lower left-lower right relationship, the difference between the abscissa of the right end point of the lateral critical wave of the identification frame located at the lower left and the abscissa of the left end point of the critical side of the identification frame located at the upper right is calculated as the abscissa difference; When the horizontal coordinate of the global coordinate system gradually increases from left to right and the horizontal coordinate difference is a positive value, the horizontal coordinate difference is used as the horizontal overlap length; and when the horizontal coordinate of the global coordinate system gradually decreases from left to right and the horizontal coordinate difference is a negative value, the absolute value of the horizontal coordinate difference is used as the horizontal overlap length.

[0011] Optionally, also include: Count the vertex coordinates of all critical identification boxes with the same number, and determine the minimum abscissa, maximum abscissa, minimum ordinate and maximum ordinate; Calculating the difference between the maximum horizontal coordinate and the minimum horizontal coordinate, and calculating the difference between the maximum vertical coordinate and the minimum vertical coordinate; Using the horizontal coordinate difference as the canvas width and the vertical coordinate difference as the canvas height to construct a new canvas; For the image areas framed by the critical identification boxes with the same number, the relative relationship is determined based on the global coordinates, and the combined image is formed by filling the new canvas based on the relative relationship.

[0012] Optionally, the method further includes: Verify whether the combined image includes correctly stitched plankton to obtain a verification result; Determine the number of adjusted numbers according to the verification result; wherein, when the combined image includes correctly spliced ​​plankton, the number of numbers is kept unchanged; and when the combined image includes incorrectly spliced ​​plankton, the number is increased according to the actual number of included plankton, wherein the number of newly added numbers is the actual number of included plankton minus one; The counting of the number of the numbers includes: counting the number of increased numbers.

[0013] In a second aspect, an embodiment of the present disclosure provides a computing device, including a processor and a memory, wherein the memory is used to store a computer program; when the computer program is loaded by the processor, the processor executes the method for counting the number of plankton in a water sample image as described above.

[0014] The disclosed embodiment first divides the water sample image into segmented images of appropriate size, performs plankton recognition on the segmented images, determines the complete recognition frame corresponding to the complete plankton and the critical recognition frame corresponding to the incomplete plankton, and then associates the critical recognition frames based on the critical type identifier of the critical recognition frame, the segmented image to which it belongs, and the adjacency relationship of the segmented images to obtain a number representing a cut plankton. Because one number represents a cut plankton and one complete recognition frame represents a complete plankton, the number of numbers and the number of complete recognition frames are added to obtain the number of plankton in the water sample image. Because the water sample image is divided into smaller segmented images and then the plankton recognition process is performed, the intermediate buffer storage data becomes smaller when the computing device processes a single segmented image, and the corresponding system can be stable, thereby making the entire processing process have better stability and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor, including Figure 1 is a flow chart of a method for counting the number of plankton in a water sample image provided by an embodiment of the present disclosure; Figure 2 It is a schematic diagram of the position relationship between the selected recognition box and the to-be-selected recognition box being in the upper left and lower right positions; Figure 3 It is a schematic diagram showing the position relationship between the selected recognition frame and the to-be-selected recognition frame being at the lower left and upper right; Figure 4 It is a schematic diagram of the splicing obtained by manually splicing two adjacent segmented images; Figure 5 It is a schematic diagram of a combined image formed by splicing two recognition frames with the same number; Figure 6 It is a schematic diagram of the structure of a computing device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0017] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0018] The term "including" and its variations used in this document are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. In this document, relational terms such as "first" and "second" are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0019] In order to enable a computing device to efficiently and stably process a water sample image and determine the number of plankton therein, the present disclosure provides a new method for counting the number of plankton in a water sample image. The method for counting the number of plankton in a water sample image provided in this embodiment can identify the number of plankton in a water sample image by segmenting the water sample image into segmented images of appropriate sizes, and then performing plankton identification and post-processing on the segmented images.

[0020] Figure 1 : is a flow chart of a method for counting the number of plankton in a water sample image provided by an embodiment of the present disclosure. Figure 1 As shown, the plankton quantity counting method provided by the embodiment of the present disclosure includes S110-S150.

[0021] S110: Segment the water body sample image to obtain segmented images and adjacency relations between the segmented images.

[0022] In the embodiment of the present disclosure, after obtaining the local microscopic images, the local microscopic images are stitched to obtain the water sample image, and then the water sample image is segmented. It should be noted here that the segmentation of the water sample image is not a simple inverse transformation of the stitching of the local microscopic images, and the goals of the two are different.

[0023] When using local microscopic images to stitch water sample images, it is necessary to consider the alignment of repeated pixels at the edges of adjacent local microscopic images and remove redundant pixels to obtain a stitched image. The water sample image is segmented so that the segmented images obtained do not overlap with each other.

[0024] It should be noted that the segmented images do not overlap with each other and it should be ensured that the pixels in the water sample image are not lost. After obtaining the segmented images, if the segmented images are reassembled according to the adjacency relationship, the water sample image can be restored.

[0025] In a specific implementation, the water sample image may be segmented according to a rectangle of a predetermined size, so that at least most of the segmented images have a rectangular size (in some cases, because the side length of the water sample image is not an integer multiple of the side length of the rectangle, the size of some of the segmented images obtained will be smaller than the size of the rectangle). The size of the aforementioned rectangle can be determined based on the image processing capability of the computing device deployed with the plankton recognition model, and the larger the size of the rectangle, the better, provided that the computing device is stable and efficient in processing.

[0026] The adjacency relationship is used to reflect the relative position relationship of the segmented images formed by segmentation in the water sample image. In the process of segmenting the water sample image, the adjacency relationship of the segmented images is determined according to the relative position of the segmented images. Specifically, according to the relative position of the segmented images in the water sample image, the adjacency relationship includes adjacent and non-adjacent, where adjacent can be further subdivided into upper and lower adjacent, left and right adjacent, and the specific upper and lower position relationship and left and right position relationship of the aforementioned upper and lower adjacent and left and right adjacent segmented images.

[0027] In a specific implementation process, when the water sample image is segmented, the row and column numbers of each segmented image are obtained from left to right and from top to bottom, and the adjacency relationship of the segmented images is determined according to the row and column numbers. For example, the row and column numbers of the segmented images can be represented by four digits, the first two digits represent the row number, and the last two digits represent the column number; if the row and column numbers of two segmented images are 0101 and 0201 respectively, it can be determined from the row and column numbers that the two are in a vertically adjacent relationship, and the lower boundary of the segmented image numbered 0101 is directly adjacent to the upper boundary of the segmented image numbered 0201; if the row and column numbers of the two segmented images are 0304 and 0305 respectively, it can be determined from the row and column numbers that the two are in a horizontally adjacent relationship, and the right boundary of the segmented image numbered 0304 is directly adjacent to the left boundary of the segmented image numbered 0305.

[0028] S120: using a plankton recognition model to process the segmented image, obtaining a complete recognition frame of complete plankton and a critical recognition frame of incomplete plankton in the segmented image, and determining a critical type identifier of the critical recognition frame according to a critical edge of the critical recognition frame.

[0029] The plankton recognition model is a pre-trained machine learning model that recognizes plankton in an image and marks the location of the plankton. The aforementioned marked plankton location is marked in the form of an identification box. Since the focus of the disclosed embodiment is not on the plankton recognition model itself, but only on the use of the plankton recognition model to process the segmented image, the model architecture and model training process of the plankton recognition model are not analyzed in detail here, and the corresponding content can be found in the relevant technical literature.

[0030] As analyzed in the previous paragraph, after the plankton recognition model is used to process the input image (specifically the segmented image), the recognition frame where the plankton is located can be obtained.

[0031] Specifically, in the process of processing the segmented image, the plankton recognition model in the embodiment of the present disclosure can not only determine the recognition frame where the plankton is located, but also determine whether the plankton selected by each recognition frame is a complete plankton or an incomplete plankton. Accordingly, the recognition frame will be identified as a complete recognition frame that selects a complete plankton or a critical recognition frame that selects an incomplete plankton.

[0032] Here we explain the naming of the critical recognition frame. In the process of segmenting the water sample image to obtain the segmented image, the image area representing a complete plankton may be divided into at least two adjacent segmented images; accordingly, the recognition frame of the incomplete plankton is the recognition frame located at the boundary of the segmented image, and its corresponding recognition frame must be the critical recognition frame.

[0033] It should also be noted here that, in the implementation of this scheme, the problem of incomplete plankton at the boundary of the water sample image itself is not considered (that is, the counting problem of incomplete plankton located at the edge of the water sample image is not considered, and the corresponding counting problem is implemented by the corresponding reasonable counting strategy).

[0034] After determining the critical identification frame of the incomplete plankton, it is then necessary to determine the critical type identifier of the aforementioned plankton identification frame. The computing device determines the critical type identifier of the critical identification frame based on the critical edge of the critical identification frame. In a specific implementation, considering that the critical identification frame is a rectangular identification frame with four frame edges, a four-bit code can be formed based on the four upper, lower, left and right frame edges, and the aforementioned four-bit code is used to characterize the critical type identifier of the critical identification frame. Specifically, in the case where one frame edge of the critical identification frame is a critical edge, the corresponding coding bit is set to 1; in the case where one frame edge is not a critical edge, the corresponding coding bit is set to 0. For example, if the right frame edge of a critical identification frame is a critical edge and the other three frame edges are non-critical edges, the corresponding critical type identifier is 0001.

[0035] In the disclosed embodiment, in order to facilitate the subsequent operations, after determining the critical identification frame in each segmented image, the critical identification frame in each segmented image will also be numbered. A two-digit decimal number is used for the critical identification frame in a segmented image. The two-digit decimal number and the number of the segmented image in the previous text constitute a six-digit global number that uniquely identifies a critical identification frame. For example, the number 010103 represents the third critical identification frame in the first row and first column of the segmented image.

[0036] S130: For each critical identification frame, execute the following S131-S132.

[0037] S131: Determine a selected recognition frame, determine the adjacent segmented image according to the critical type identifier, the corresponding segmented image and the adjacent relationship, and determine the candidate recognition frame among all the critical recognition frames included in the adjacent segmented image according to the critical type identifier.

[0038] As analyzed above, the global number and critical type identifier of each critical recognition frame have been determined. After a critical recognition frame is determined as a selected recognition frame, the segmented image to which the selected recognition frame belongs and its critical type identifier can be determined.

[0039] After determining the critical type identification of the selected recognition frame and the segmented image to which it belongs, the adjacent segmented image can be determined with reference to the adjacency relationship determined previously.

[0040] For example, if the critical type identifier of a selected recognition box is 0001 and its global number is 010102, it is determined to be the second recognition box of the first row and first column segmented image with the right frame as the critical edge. The corresponding associated adjacent segmented image is the segmented image of the first row and second column, that is, the segmented image with the row and column number 0102.

[0041] After determining the aforementioned adjacent segmented images, the critical recognition frame located in the aforementioned segmented images can then be retrieved. Because the selected recognition frame is the recognition frame that is critical to the right frame, the candidate recognition frame determined according to the critical type identification of the selected recognition frame is the recognition frame whose critical edge in the critical segmented image includes the left frame, that is, the recognition frame with the critical type identification of XX10 (the aforementioned X may be 0 or 1, and is not limited thereto).

[0042] For another example, if the critical type identifier of a selected recognition box is 0101 and its global number is 010103, it is determined to be the third recognition box of the segmented image in the first row and first column, and the right and bottom borders are the recognition boxes of the critical edges. The corresponding associated adjacent images are the segmented image in the first row and second column and the segmented image in the second row and first column, that is, the segmented images with row and column numbers 0102 and 0201. After determining the aforementioned critical segmentation image, according to the critical type identifier of the selected identification frame, determine: (1) in the identification frame of the segmentation image with row and column number 0102, the identification frame with the critical identifier XX10 (here, for the sake of safety, the identification frame XX10 is determined as the selected identification frame. In specific applications, considering that it is highly likely that only the identification frame with the critical edge including the lower side may be the identification frame to be selected, the identification frame with the critical identifier 0110 may also be selected as the identification frame to be selected); (2) in the identification frame of the segmentation image with row and column number 0201, the identification frame with the critical identifier 10XX (here, for the sake of safety, the identification frame 10XX is determined as the selected identification frame. In specific applications, considering that it is highly likely that only the identification frame with the critical edge including the right side may be the identification frame to be selected, the identification frame with the critical identifier 1001 may also be selected as the identification frame to be selected). Accordingly, in this case, the identification frames to be selected in different adjacent segmentation images need to be respectively executed as follows S130.

[0043] S132: Determine a target recognition frame in each of the candidate recognition frames according to the global coordinates of the critical edges of the selected recognition frame and the global coordinates of the critical edges of each of the candidate recognition frames, and assign the target recognition frame the same number as that of the selected recognition frame.

[0044] The global coordinates mentioned here are coordinates in the water sample image. Specifically, the target recognition frame is determined according to the global coordinates of the critical edge of the selected recognition frame and the global coordinates of the critical edge of the to-be-selected recognition frame, and the recognition frame having at least a preset overlap length with the selected recognition frame is determined according to the global coordinates.

[0045] In a specific implementation, the data used to determine the target recognition frame is different according to the critical type identifier of the selected recognition frame (that is, which frame the critical edge is).

[0046] In some cases, when the critical type identifier of the selected recognition box includes a left critical identifier or a right critical identifier (that is, the selected recognition box and the to-be-selected recognition box are left and right adjacent recognition boxes), S132 specifically includes the following S1321-S1322.

[0047] S1321: Calculate the longitudinal overlap length of the global longitudinal coordinate of the longitudinal critical edge of the selected identification frame and the global longitudinal coordinate of each longitudinal critical edge of the to-be-selected identification frame.

[0048] S1322: The candidate recognition frame whose longitudinal overlap length is greater than the preset overlap length is used as the target recognition frame.

[0049] When the critical type identifier of the selected recognition frame includes a left critical identifier or a right critical identifier, it is determined that the selected recognition frame and the to-be-selected recognition frame are in a left-right adjacent relationship. At this time, the selected recognition frame and the to-be-selected recognition frame may overlap in the vertical direction. It is only necessary to determine which to-be-selected recognition frame can be used as the target recognition frame through the overlapping length in the vertical direction.

[0050] Specifically, as analyzed in S1321, the computing device calculates the longitudinal overlap length between the critical edges of each candidate recognition frame and the longitudinal critical edge of the selected recognition frame. Then, if it is determined that the longitudinal overlap length is greater than the preset overlap length, the corresponding candidate recognition frame is used as the target recognition frame.

[0051] In actual applications, it is found that when the selected recognition frame and the target recognition frame are adjacent to each other through a longitudinal critical edge, in most cases, the two are in a lower left-upper right relationship or an upper left-lower right relationship. The corresponding method of calculating the longitudinal overlap length varies according to the relative position relationship between the two. Therefore, it is first necessary to determine the relative position relationship between the two based on the global longitudinal coordinate of the longitudinal critical edge of the selected recognition frame and the global longitudinal coordinate of the longitudinal critical edge of a candidate recognition frame.

[0052] As analyzed above, the aforementioned relative position relationship is one of the lower left-upper right relationship or the upper left-lower right relationship. In the specific implementation, it can be determined according to the midpoint position of the longitudinal critical edges of the two. Specifically, the midpoint ordinate of the longitudinal critical edge of the selected identification frame can be determined, and the midpoint ordinate of the longitudinal critical edge of a selected identification frame can be determined, and the relative position relationship between the two can be determined according to the midpoint ordinates of the two. If the midpoint ordinate of the longitudinal critical edge of the identification frame on the left is located above the midpoint ordinate of the longitudinal critical edge of the identification frame on the right, the relative position relationship is determined to be the upper left-lower right relationship; and if the midpoint ordinate of the critical edge of the identification frame on the left is located below the midpoint coordinate of the midpoint of the longitudinal critical edge of the identification frame on the right, the relative position relationship is determined to be the lower left-upper right relationship.

[0053] After the relative position relationship is determined, the aforementioned step S1321 of calculating the longitudinal overlap length includes S1321A-S1321C.

[0054] S1321A: When the relative position relationship is the upper left-lower right relationship, calculate the difference between the ordinate of the lower end point of the longitudinal critical edge of the identification frame located at the upper left and the upper end point of the longitudinal critical edge of the identification frame located at the lower right as the ordinate difference. S1321B: When the relative position relationship is a lower left-lower right relationship, calculate the difference between the ordinate of the lower end point of the longitudinal critical edge of the identification frame located at the upper right and the upper end point of the longitudinal critical edge of the identification frame located at the lower left as the ordinate difference.

[0055] S1321C: When the ordinate of the global coordinate system increases gradually from top to bottom and the ordinate difference is a positive value, the ordinate difference is taken as the longitudinal overlap length; and when the ordinate of the global coordinate system decreases gradually from top to bottom and the ordinate difference is a negative value, the absolute value of the ordinate difference is taken as the longitudinal overlap length. Figure 2 is a schematic diagram of the position relationship between the selected recognition box and the candidate recognition box in the upper left and lower right positions. Figure 2 As shown, when the selected identification frame and the to-be-selected identification frame are in the upper left and lower right relationship, if the two are not two parts of a microbial microscopic image, then the selected identification frame and the to-be-selected identification frame are not adjacent identification frames, or although they are adjacent, the adjacent length is very short. The length that reflects the critical relationship between the two can be determined by the difference in the ordinate of the lower endpoint of the longitudinal critical edge of the identification frame located in the upper left and the upper endpoint of the longitudinal critical edge of the identification frame located in the lower right. Specifically, the difference in the ordinate of the lower endpoint A of the longitudinal critical edge of the identification frame located in the upper left and the upper endpoint B of the longitudinal critical edge of the identification frame located in the upper right is calculated as the ordinate difference.

[0056] When the ordinate of the global coordinate system increases gradually from top to bottom, if the ordinate difference is a positive value, it is determined that the identification box located at the upper left and the identification box located at the lower right are partially overlapped, and the ordinate difference can be used as the longitudinal overlap length. On the contrary, when the ordinate of the global coordinate system decreases gradually from top to bottom, if the ordinate difference is a negative value, it is determined that the identification box located at the upper left and the identification box located at the lower right are partially overlapped, and the absolute value of the ordinate difference can be used as the longitudinal overlap length.

[0057] Figure 3 is a schematic diagram showing the position relationship between the selected recognition box and the candidate recognition box, which are at the lower left and upper right. Figure 3 As shown, similar to the previous analysis, when the relative position relationship is the lower left-upper right relationship, the difference in the ordinate of the lower end point C of the longitudinal critical edge of the identification frame located at the lower left and the upper end point D of the longitudinal critical edge of the identification frame located at the lower left is calculated, and according to the global coordinate system and the positive and negative situation of the ordinate difference, whether the absolute value of the ordinate difference can be used as the longitudinal overlap length.

[0058] In some embodiments, the selected recognition frame and the to-be-selected recognition frame may be in a left-right relationship, where the left-right relationship means that the selected recognition frame and the to-be-selected recognition frame are substantially in a left-right position relationship, and the longitudinal critical edge of the recognition frame with the longer longitudinal critical edge completely covers the longitudinal critical edge of the other recognition frame.

[0059] In the case where the selected identification frame and the to-be-selected identification frame are in a left-right relationship, there is also a longitudinal overlap length between the selected identification frame and the to-be-selected identification frame. In this case, the first ordinate difference between the upper end point of the longitudinal critical edge of the selected identification frame and the upper end point of the longitudinal critical edge of the to-be-selected identification frame can be calculated, and the second ordinate difference between the lower end point of the longitudinal critical edge of the selected identification frame and the lower end point of the longitudinal critical edge of the to-be-selected identification frame can be calculated. In the case where one of the first ordinate difference and the second ordinate difference is a positive value and the other is a negative value, the longitudinal critical edge length of the identification frame with the shorter longitudinal critical edge is determined as the longitudinal overlap length. In actual applications, it is found that due to the identification method of the identification frame, the probability of the selected identification frame and the to-be-selected identification frame having the aforementioned left-right position relationship is not high, and in actual applications, this position relationship can also be ignored to determine the target identification frame.

[0060] In some other cases, when the critical type identifier of the selected identification box includes an upper critical identifier or a lower critical identifier (that is, the selected identification box and the to-be-selected identification box are upper and lower adjacent identification boxes), S132 specifically includes the following S1323-S1324.

[0061] S1323: Calculate the horizontal overlap length of the global horizontal coordinate of the critical edge of the selected recognition frame and the global horizontal coordinate of the critical edges of each of the to-be-selected recognition frames.

[0062] S1324: The candidate recognition frame whose horizontal overlap length is greater than the preset overlap length is used as the target recognition frame.

[0063] When the critical type identifier of the selected recognition frame includes an upper critical identifier or a lower critical identifier, it is determined that the selected recognition frame and the candidate recognition frame are in a vertically adjacent relationship. At this time, the selected recognition frame and the candidate recognition frame overlap in the horizontal direction. It is only necessary to determine which candidate recognition frame can be used as the target recognition frame through the overlapping length in the horizontal direction.

[0064] Specifically, as analyzed in S1323, the computing device calculates the longitudinal overlap length between the critical edges of each candidate recognition frame and the horizontal critical edges of the selected recognition frame. Then, if it is determined that the horizontal overlap length is greater than the preset overlap length, the corresponding candidate recognition frame is used as the target recognition frame.

[0065] In actual applications, it is found that when the selected recognition frame and the target recognition frame are adjacent to each other through a horizontal critical edge, in most cases the two are also in a lower left-upper right relationship or an upper left-lower right relationship. The corresponding method of calculating the horizontal overlap length varies according to the different relative positional relationships between the two. Therefore, it is first necessary to determine the relative positional relationship between the two based on the global horizontal coordinates of the horizontal critical edge of the selected recognition frame and the global horizontal coordinates of the horizontal critical edge of a candidate recognition frame.

[0066] As analyzed above, the aforementioned relative position relationship is one of the lower left-upper right relationship or the upper left-lower right relationship. In the specific implementation, it can be determined according to the midpoint position of the transverse critical edges of the two. Specifically, the horizontal coordinate of the midpoint of the transverse critical edge of the identification frame located on the upper side can be determined, and the horizontal coordinate of the midpoint of the transverse critical edge of the identification frame located on the lower side can be determined, and the relative position relationship between the two can be determined according to the midpoint horizontal coordinates of the two. If the horizontal coordinate of the midpoint of the transverse critical edge of the identification frame located on the upper side is located to the left of the horizontal coordinate of the midpoint of the transverse critical edge of the identification frame on the lower side, the relative position relationship is determined to be the upper left-lower right relationship; and if the horizontal coordinate of the midpoint of the transverse critical edge of the identification frame located on the upper side is located to the right of the midpoint coordinate of the transverse critical edge of the other frame on the lower side, the relative position relationship is determined to be the lower left-upper right relationship.

[0067] After the relative position relationship is determined, the aforementioned step S1323 of calculating the lateral overlap length includes S1323A-S1323C.

[0068] S1323A: When the relative position relationship is the upper left-lower right relationship, calculate the difference between the horizontal coordinate of the right end point of the horizontal critical edge of the identification frame located at the upper left and the horizontal coordinate of the left end point of the horizontal critical edge of the identification frame located at the lower right as the horizontal coordinate difference.

[0069] S1323B: When the relative position relationship is a lower left-lower right relationship, calculate the difference between the horizontal coordinate of the right end point of the horizontal critical edge of the identification frame located at the lower left and the horizontal coordinate of the left end point of the horizontal critical edge of the identification frame located at the upper right as the horizontal coordinate difference.

[0070] S1323C: When the horizontal coordinate of the global coordinate system gradually increases from left to right and the horizontal coordinate difference is a positive value, the horizontal coordinate difference is used as the horizontal overlap length; and when the horizontal coordinate of the global coordinate system gradually decreases from left to right and the horizontal coordinate difference is a negative value, the absolute value of the horizontal coordinate difference is used as the horizontal overlap length. Similar to the analysis in the previous article, when the selected identification frame and the to-be-selected identification frame are in the upper left and lower right relationship, if the two are not two parts of a microbial microscopic image, then the selected identification frame and the to-be-selected identification frame are not adjacent identification frames, or although they are adjacent, the adjacent length is very short. The adjacent length of the two can be determined by the difference in the horizontal coordinates of the right end point of the transverse critical edge of the identification frame located in the upper left and the left end point of the transverse critical edge of the identification frame located in the lower right. Specifically, the difference in the horizontal coordinates of the right end point of the transverse critical edge of the identification frame located in the upper left and the left end point of the transverse critical edge of the identification frame located in the lower right is calculated as the horizontal coordinate difference.

[0071] When the horizontal coordinate of the global coordinate system increases from left to right, if the horizontal coordinate difference is a positive value, it is determined that the identification box located at the upper left and the identification box located at the lower right are partially overlapped, and the horizontal coordinate difference can be used as the horizontal overlap length. On the contrary, when the horizontal coordinate of the global coordinate system decreases from left to right, if the horizontal coordinate difference is a negative value, it is determined that the identification box located at the upper left and the identification box located at the lower right are partially overlapped, and the absolute value of the horizontal coordinate difference can be used as the horizontal overlap length.

[0072] Similar to the previous analysis, when the relative position relationship is lower left-upper right, the horizontal coordinate difference of the right end point of the horizontal critical edge of the identification frame located at the lower left and the left end point of the horizontal critical edge of the identification frame located at the upper right is calculated, and according to the global coordinate system and the positive and negative situation of the horizontal coordinate difference, whether the absolute value of the horizontal coordinate difference can be used as the horizontal overlap length.

[0073] In some other embodiments, when the critical type identifier includes an upper critical identifier or a lower critical identifier, the selected recognition frame and the to-be-selected recognition frame may be in an upper-lower relationship, and the upper-lower relationship means that the selected recognition frame and the to-be-selected recognition frame are generally arranged in an upper-lower relationship, and the lateral critical edge of the recognition frame with a longer lateral critical edge completely covers the lateral critical edge of the other recognition frame. In this case, there is also a lateral overlap length between the selected recognition frame and the to-be-selected recognition frame. In this case, the first horizontal coordinate difference between the left end point of the lateral critical edge of the selected recognition frame and the left end point of the lateral critical edge of the to-be-selected recognition frame can be calculated, and the second horizontal coordinate difference between the right end point of the lateral critical edge of the selected recognition frame and the right end point of the lateral critical edge of the to-be-selected recognition frame can be calculated. In the case where one of the first horizontal coordinate difference and the second horizontal coordinate difference is a positive value and the other difference is a negative value, the lateral critical edge length of the recognition frame with a shorter lateral critical edge is determined as the lateral overlap length. In actual applications, it is found that due to the identification method of the recognition frame, the probability of the selected recognition frame and the to-be-selected recognition frame having the aforementioned upper-lower position relationship is not high, and in actual applications, this position relationship can also be ignored to determine the target recognition frame.

[0074] After determining the target recognition frame corresponding to the selected recognition frame, the computing device then assigns the same number to the target recognition frame as the selected recognition frame. The number is a unique number used to identify that the selected recognition frame and the target recognition frame are associated together. The aforementioned S130 is used to process each critical recognition frame, that is, the target recognition frame corresponding to each critical recognition frame can be determined and the corresponding number can be assigned.

[0075] In the specific implementation, in order to be able to traverse all critical identification frames in an orderly manner through the computing device and then determine the numbers of all critical identification frames, the computing device usually starts from the segmented image corresponding to the coordinate origin, processes the critical identification frames of all segmented images along the rows and columns, and determines the target identification frame associated with each critical identification frame in each segmented image in turn, and assigns corresponding numbers.

[0076] After the numbers of all the boundary recognition boxes are determined, S130 is completed.

[0077] S140: Count the number of complete recognition frames and the number of serial numbers.

[0078] S150: Calculate the sum of the number of complete identification frames and numbers, and determine the statistical number of plankton in the water sample image based on the sum of the numbers.

[0079] In a specific implementation, the computing device assigns a unique identification number to each complete identification frame, and the number of complete identification frames can be obtained by counting the identification numbers. Similarly, the number of numbers can be obtained by counting the numbers. After the number sum is obtained by adding the number of complete identification frames and numbers, the number of plankton in the water sample image can be determined based on the number sum.

[0080] In a specific implementation, without considering the incomplete plankton at the edge of the water body sample image, the aforementioned sum of numbers can be directly used as the statistical number of plankton in the water body sample image.

[0081] As analyzed above, in order to enable the computing device to efficiently and stably process the water sample image to determine the number of plankton in the water sample, the disclosed embodiment first divides the water sample image into segmented images of appropriate size, and then performs plankton recognition on the segmented images, determines the complete recognition frame corresponding to the complete plankton and the critical recognition frame corresponding to the incomplete plankton, and then associates the critical recognition frames based on the critical type identifier of the critical recognition frame, the segmented image to which it belongs, and the adjacency relationship of the segmented images, to obtain a number representing a cut plankton. Because one number represents a cut plankton and one complete recognition frame represents a complete plankton, the number of plankton in the water sample image can be obtained by adding the number of numbers and the number of complete recognition frames.

[0082] In the previous article, it is assumed that the critical edges of all incomplete plankton are directly on the boundary of the segmented image. However, in reality, due to the problem of plankton recognition model processing, some incomplete plankton are located at the boundary of the segmented image, but the critical edge of the corresponding recognition box is not the boundary of the segmented image. In this case, the critical edge of the critical recognition box that selects the incomplete plankton is not the boundary of the segmented image. In this case, it may appear that the critical edge of a selected recognition box is adjacent to the critical edge of the to-be-selected recognition box, but the distance between the two is still large, and they cannot be combined into an image representing a plankton. Accordingly, in this case, the longitudinal overlap length cannot be directly calculated by the aforementioned method to determine whether the two are assigned the same number.

[0083] To solve this problem, before executing the aforementioned S1321, the computing device may calculate the horizontal coordinate difference based on the global horizontal coordinate of the longitudinal critical edge of the to-be-selected identification frame and the global horizontal coordinate of the longitudinal critical edge of the to-be-selected identification frame, and will only execute S1321 if the horizontal coordinate difference is less than a preset difference threshold. Similarly, before executing the aforementioned S1323, the computing device may calculate the vertical coordinate difference based on the global vertical coordinate of the transverse critical edge of the to-be-selected identification frame and the global vertical coordinate of each transverse critical edge of the to-be-selected identification frame, and will only execute S1323 if the vertical coordinate difference is less than a preset difference threshold.

[0084] In the above method, it is assumed that a numbered boundary identification box is assigned to represent the same plankton. However, after actual processing, it is found that the aforementioned numbered boundary identification box may be wrong, resulting in wrong counting of plankton. To solve this problem, in some embodiments, after determining the number of each critical identification box, the following S160-S190 can also be performed.

[0085] S160: Counting the coordinates of the vertices of the critical identification boxes with the same number, and determining the minimum horizontal coordinate, the maximum horizontal coordinate, the minimum vertical coordinate, and the maximum vertical coordinate.

[0086] S170: Calculate the abscissa difference between the maximum abscissa and the minimum abscissa, and calculate the ordinate difference between the maximum ordinate and the minimum ordinate.

[0087] S180: Using the horizontal coordinate difference as the canvas width and the vertical coordinate difference as the canvas height to construct a new canvas.

[0088] S190: For the image areas selected by the critical identification frames with the same number, a relative relationship is determined based on the global coordinates, and the relative relationship is filled into the new canvas to form a combined image.

[0089] Combined with the analysis of the reasons why the critical identification box is identified in the previous article (because when the water sample image is segmented into segmented images, the complete plankton therein is segmented into incomplete plankton), it can be imagined that the new canvas constructed by using the horizontal coordinate difference as the canvas width and the vertical coordinate difference as the canvas height can accommodate the pixels representing the segmented plankton. Accordingly, all the critical image areas selected by the frame under a number are determined in relative relationship according to the global coordinates and filled into the new canvas, and a restored image representing the segmented plankton can be obtained. In practical applications, the aforementioned restored image may be an image that incorrectly represents plankton, or it may be an image that correctly represents plankton.

[0090] Figure 4 It is a schematic diagram of the splicing obtained by manually splicing two adjacent segmented images; Figure 5 is a schematic diagram of a combined image formed by splicing two recognition frames with the same number. Figure 4 and Figure 5 , after combining two critical identification frames with the same number, a composite image representing a complete plankton is formed, which has the same effect as manual splicing. The number of plankton in it is 1.

[0091] In addition, in some embodiments of the present disclosure, before executing the aforementioned S150 to count the number of numbers, the computing device may also execute the following S200 - S210 .

[0092] S200: Verify whether the combined image includes correctly spliced ​​plankton to obtain a verification result.

[0093] S210: Determine the number of adjustment numbers according to the verification result.

[0094] In a specific implementation, the aforementioned combined image can be manually verified to be a correct image representing the plankton to obtain a verification result. If the combined image is not an image that correctly represents the plankton, the number is adjusted according to a predetermined number modification rule, specifically: when the combined image includes correctly spliced ​​plankton, the number is kept unchanged; when the combined image includes incorrectly spliced ​​plankton, the number is increased according to the actual number of plankton included, wherein the number of newly added numbers is the actual number of plankton included minus one.

[0095] In some other embodiments, after obtaining the aforementioned combined image, the combined image may be reprocessed using a plankton recognition model to obtain a new plankton recognition frame. When it is determined that there is one new plankton recognition frame, it is determined that the combined image represents the correct plankton. When it is determined that there are more than one new plankton recognition frame, the aforementioned manual verification method is used to verify whether the combined image represents one plankton, and then determine whether to adjust the number of numbers.

[0096] When executing the aforementioned S200 - S210 , the aforementioned S140 counting the number of serial numbers specifically refers to the number of all serial numbers after statistical adjustment.

[0097] In some embodiments, in the process of using the plankton recognition model to process the segmented image, the computing device outputs the plankton type of the complete recognition frame. After obtaining the combined image, the computing device also uses the plankton recognition model to process the combined image, obtain a new plankton recognition frame, and determine the plankton type in the new plankton recognition frame. Accordingly, according to the plankton types of the complete recognition frame and the new plankton recognition frame, the number of various plankton can also be determined.

[0098] In addition to providing the aforementioned method for counting the number of plankton in a water sample image, the embodiment of the present disclosure also provides a computing device for implementing the aforementioned method. Figure 6 Schematic diagram of the structure of the computing device provided by the embodiment of the present disclosure. Figure 6 , which shows a schematic diagram of the structure of a computing device 600 suitable for implementing the embodiments of the present disclosure. Figure 6 The computing device shown is only an example and should not bring any limitation to the functionality and scope of use of the embodiments of the present disclosure.

[0099] like Figure 6 As shown, the computing device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory ROM 602 or a program loaded from a storage device 608 to a random access memory RAM 603. Various programs and data required for the operation of the computing device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output I / O interface 605 is also connected to the bus 604.

[0100] Typically, the following devices may be connected to the I / O interface 605: input devices 605 including, for example, a touch screen, a touch pad, a camera, a microphone, etc.; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 608 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 609. The communication devices 609 may allow the computing device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The computing device 600 is shown with various devices, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have instead.

[0101] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0102] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable storage medium, a computer-readable signal medium, or any combination of the above two.

[0103] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.

[0104] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0105] In some embodiments, the client and computing devices may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0106] The computer-readable medium may be included in the computing device, or may exist independently without being incorporated into the computing device.

[0107] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the tester's computer, partially on the tester's computer, as a separate software package, partially on the tester's computer and partially on a remote computer, or entirely on a remote computer or computing device. In cases involving a remote computer, the remote computer may be connected to the tester's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0108] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated system based on hardware that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0109] The units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. The name of the unit does not constitute a limitation on the unit itself in some cases. The functions described above in this article may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: field programmable gate array (FPGA), application specific integrated circuit (ASIC), application specific standard product (ASSP), system on chip (SOC), complex programmable logic device (CPLD), etc.

[0110] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. 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 disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for counting the number of plankton in a water sample image, characterized in that: include: Segmenting the water sample image to obtain segmented images and adjacency relationships between the segmented images; Processing the segmented image using a plankton recognition model to obtain a complete recognition frame of complete plankton and a critical recognition frame of incomplete plankton in the segmented image, and determining a critical type identifier of the critical recognition frame according to a critical edge of the critical recognition frame; For each critical recognition frame, the following operations are performed: for a selected recognition frame, the adjacent segmented image is determined according to the critical type identifier, the segmented image to which it belongs, and the adjacent relationship, and a candidate recognition frame is determined according to the critical type identifier among all critical recognition frames included in the adjacent segmented image; and, according to the global coordinates of the critical edge of the selected recognition frame and the global coordinates of the critical edges of each candidate recognition frame, a target recognition frame is determined among each candidate recognition frame, and the target recognition frame is assigned the same number as that of the selected recognition frame; wherein the global coordinates are coordinates in the water body sample image, and the target recognition frame is a recognition frame having at least a preset overlap length with the selected recognition frame; Counting the number of the complete recognition frames and the number of the serial numbers; The sum of the complete identification frames and the serial numbers is obtained, and the statistical quantity of plankton in the water sample image is determined based on the sum of the numbers.

2. The method according to claim 1, characterized in that In the case where the critical type identifier includes a left critical identifier or a right critical identifier, determining a target recognition frame in each of the candidate recognition frames according to the global coordinates of the critical edge of the selected recognition frame and the global coordinates of the critical edges of each of the candidate recognition frames includes: Calculating the longitudinal overlap length of the global longitudinal coordinate of the longitudinal critical edge of the selected identification frame and the global longitudinal coordinate of the longitudinal critical edges of each to-be-selected identification frame; The candidate recognition frame whose longitudinal overlap length is greater than the preset overlap length is used as the target recognition frame.

3. The method according to claim 2, characterized in that The calculating of the longitudinal overlap length of the global longitudinal coordinate of the longitudinal critical edge of the selected identification frame and the global longitudinal coordinate of the longitudinal critical edges of each to-be-selected identification frame comprises: Determine the relative positional relationship between the selected identification frame and a candidate identification frame according to the global longitudinal coordinate of the longitudinal critical edge of the selected identification frame, wherein the relative positional relationship is an upper left-lower right relationship or a lower left-upper right relationship; In the case where the relative position relationship is an upper left-lower right relationship, the difference between the ordinate of the lower end point of the longitudinal critical edge of the identification frame located at the upper left and the ordinate of the upper end point of the longitudinal critical edge of the identification frame located at the lower right is calculated as the ordinate difference; and When the relative position relationship is a lower left-lower right relationship, the difference between the ordinate of the lower end point of the longitudinal critical edge of the identification frame located at the upper right and the ordinate of the upper end point of the longitudinal critical edge of the identification frame located at the lower left is calculated as the ordinate difference; When the ordinate of the global coordinate system gradually increases from top to bottom and the ordinate difference is a positive value, the ordinate difference is used as the longitudinal overlap length; and when the ordinate of the global coordinate system gradually decreases from top to bottom and the ordinate difference is a negative value, the absolute value of the ordinate difference is used as the longitudinal overlap length.

4. The method according to claim 3, characterized in that The determining of the relative positional relationship between the longitudinal critical edge of the selected identification frame and the longitudinal critical edge of a to-be-selected identification frame according to the global longitudinal coordinate of the longitudinal critical edge of the selected identification frame comprises: Determine the ordinate of the midpoint of the longitudinal critical edge of the selected identification frame, and determine the ordinate of the midpoint of the longitudinal critical edge of the to-be-selected identification frame; The relative position relationship between the two is determined based on the two midpoint vertical coordinates, wherein when the midpoint vertical coordinate of the longitudinal critical edge of the identification frame on the left is located on the upper side of the midpoint vertical coordinate of the longitudinal critical edge of the to-be-selected identification frame on the right, the relative position relationship is determined to be an upper left-lower right relationship, and when the midpoint vertical coordinate of the longitudinal critical edge of the identification frame on the left is located on the lower side of the midpoint vertical coordinate of the longitudinal critical edge of the identification frame on the right, the relative position relationship is determined to be a lower left-upper right relationship.

5. The method according to claim 2, characterized in that: According to the global coordinates of the critical edges of the selected recognition frame and the global coordinates of the critical edges of each of the candidate recognition frames, determining the target recognition frame in each of the candidate recognition frames further includes: Calculate the horizontal coordinate difference according to the global horizontal coordinate of the longitudinal critical edge of the to-be-selected identification frame and the global horizontal coordinates of the longitudinal critical edges of each to-be-selected identification frame; When the horizontal coordinate difference is less than a preset difference threshold, an operation of calculating the longitudinal overlap length is performed.

6. The method according to claim 1, characterized in that In the case where the critical type identifier includes an upper critical identifier or a lower critical identifier, determining a target recognition frame in each of the candidate recognition frames according to the global coordinates of the critical edge of the selected recognition frame and the global coordinates of the critical edges of each of the candidate recognition frames includes: Calculating the horizontal overlap length of the global horizontal coordinate of the critical edge of the selected identification frame and the global horizontal coordinate of the critical edge of each to-be-selected identification frame; The candidate recognition frame whose horizontal overlap length is greater than the preset overlap length is used as the target recognition frame.

7. The method according to claim 6, characterized in that The step of calculating the horizontal overlap length of the global horizontal coordinate of the critical edge of the selected identification frame and the global horizontal coordinate of the critical edges of each to-be-selected identification frame includes: Determine the relative position relationship between the selected identification frame critical edge and a to-be-selected identification frame critical edge according to the global horizontal coordinate of the two, wherein the relative position is an upper left-lower right relationship or a lower left-upper right relationship; In the case where the relative position relationship is an upper left-lower right relationship, calculating the difference between the abscissa of the right end point of the horizontal critical edge of the identification frame located at the upper left and the abscissa of the left end point of the horizontal critical edge of the identification frame located at the lower right as the abscissa difference; and In the case where the relative position relationship is a lower left-lower right relationship, the difference between the abscissa of the right end point of the lateral critical wave of the identification frame located at the lower left and the abscissa of the left end point of the critical side of the identification frame located at the upper right is calculated as the abscissa difference; When the horizontal coordinate of the global coordinate system gradually increases from left to right and the horizontal coordinate difference is a positive value, the horizontal coordinate difference is used as the horizontal overlap length; and when the horizontal coordinate of the global coordinate system gradually decreases from left to right and the horizontal coordinate difference is a negative value, the absolute value of the horizontal coordinate difference is used as the horizontal overlap length.

8. The method according to any one of claims 1 to 7, characterized in that: Also includes: Count the vertex coordinates of all critical identification boxes with the same number, and determine the minimum abscissa, maximum abscissa, minimum ordinate and maximum ordinate; Calculating a difference between the maximum horizontal coordinate and the minimum horizontal coordinate, and calculating a difference between the maximum vertical coordinate and the minimum vertical coordinate; Using the horizontal coordinate difference as the canvas width and the vertical coordinate difference as the canvas height to construct a new canvas; For the image areas framed by the critical identification boxes with the same number, the relative relationship is determined based on the global coordinates, and the combined image is formed by filling the new canvas based on the relative relationship.

9. The method according to claim 8, characterized in that The method further comprises: Verify whether the combined image includes correctly stitched plankton to obtain a verification result; Determine the number of adjusted numbers according to the verification result; wherein, when the combined image includes correctly spliced ​​plankton, the number of numbers is kept unchanged; and when the combined image includes incorrectly spliced ​​plankton, the number is increased according to the actual number of included plankton, wherein the number of newly added numbers is the actual number of included plankton minus one; The counting of the number of the numbers includes: counting the number of added numbers.

10. A computing device, characterized in that It comprises a processor and a memory, wherein the memory is used to store a computer program; when the computer program is loaded by the processor, the processor executes the method for counting the number of plankton in a water sample image as claimed in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Identification box determination method and device based on target detection and terminal device

    CN109886997A

  • Fiber counting method, storage medium and device

    CN115205221A

  • Microcystis identification and counting method based on image processing

    CN117912012A

  • Target identification counting method and device based on image segmentation and deep learning

    CN118097121A

  • System and method of counting livestock

    US20220104463A1