A method, apparatus and readable storage medium for counting phytoplankton
By preprocessing and feature detection of images of marine phytoplankton, the error problem of automatic identification of marine phytoplankton in the existing technology is solved, high-accuracy phytoplankton counting is achieved, and the manual identification process is simplified.
Patent Information
- Application Number
- CN202210263479.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-17
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-03-17
AI Technical Summary
There are errors in the automatic identification and identification of marine phytoplankton in the existing technology, and it requires manual expertise, which is time-consuming and labor-intensive. The identification of existing microscopic image processing software is not accurate enough.
Phytoplankton counting is achieved by image extraction and preprocessing of slide samples of original phytoplankton liquids, circular detection, center detection and invalid pixel point elimination, combined with connected area identification. Specific steps include grayscale, image enhancement, image denoising, circular Hough transform algorithm detection and threshold setting, deleting invalid areas and improving the recognition of image processing.
It improves the accuracy of marine phytoplankton cell counting, reduces errors, realizes automated phytoplankton identification, and saves the time and energy of manual identification.
Smart Images

Figure CN114663378B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a phytoplankton counting method, device and readable storage medium. Background Art
[0002] Under current conditions, the classification and identification of marine phytoplankton is usually done manually, which requires a high level of classification expertise and is time-consuming and laborious. Therefore, it is very important and urgent to use computers to replace manual work to automatically identify and recognize marine phytoplankton species.
[0003] Although some existing microscopic image processing software provide simple image analysis functions, they are all based on simple geometric parameter measurement and counting functions. Considering the complex background images and the characteristics of marine phytoplankton cells, the image processing methods in the existing technology are not accurate enough and have certain errors. Summary of the invention
[0004] The purpose of the present invention is to provide a phytoplankton counting method, device and readable storage medium to solve one or more technical problems existing in the prior art and at least provide a beneficial choice or create conditions.
[0005] In order to achieve the above object, the present invention provides the following technical solutions:
[0006] A method for counting phytoplankton, comprising the following steps:
[0007] performing image extraction on a glass slide sample of the original phytoplankton liquid to obtain a microscopic image of the glass slide sample;
[0008] Preprocessing the microscopic image to obtain a first image;
[0009] Performing circle detection on the first image to obtain a circular area contained in the first image;
[0010] Performing center detection on the circular area included in the first image to obtain a candidate center of the circular area included in the first image;
[0011] Eliminate invalid pixels in the first image according to the candidate center of the first image to obtain a second image;
[0012] Identify the connected areas in the second image, remove invalid areas, and obtain a third image;
[0013] The connected areas in the third image are identified to obtain a phytoplankton counting result.
[0014] Further, the preprocessing of the microscopic image to obtain a first image includes:
[0015] Grayscale conversion, image enhancement and image denoising are performed on the microscopic image to obtain a first image.
[0016] Further, performing circle detection on the first image to obtain a circular area contained in the first image includes:
[0017] Perform image segmentation, morphological operation and edge detection on the first image to obtain a circular area included in the first image.
[0018] Further, performing center detection on the circular area included in the first image to obtain a candidate center of the circular area included in the first image includes:
[0019] A circular Hough transform algorithm is used to detect the center of the circular area included in the first image to obtain a candidate center of the circular area included in the first image.
[0020] Further, removing invalid pixels in the first image according to the candidate center of the first image to obtain the second image includes:
[0021] Establish an xy coordinate system for the first image, with the positive direction of the x-axis being from left to right and the positive direction of the y-axis being from top to bottom;
[0022] Record the position information of each candidate center in the first image, and project the candidate center (xi, yi) onto the x-axis and y-axis respectively, and obtain the coordinates of the two projection points as (xi, 0) and (0, yi) respectively; wherein the size of the first image is M×N, i=1, 2, ..., M, j=1, 2, ..., N;
[0023] Calculate the distance between adjacent projection points on the x-axis and y-axis respectively; among them, the distance between two adjacent projection points on the x-axis (x i ,0) and (x i+1 ,0) is dx i,i+1 =|x i+1 -x i |, two adjacent projection points on the y-axis (0,y j ) and (0,y j+1 ) is dy j,j+1 =|y j+1 -y j |;
[0024] Determine the first distance threshold when In the first image, delete all the x-axis coordinates in [x i,x i+1 ] within the range of pixels; when In the first image, delete all the y-axis coordinates in [y j ,y j+1 ] pixels within the range;
[0025] For the first image, if (x i ,0) or (0,y j ) is the first projection point on the coordinate axis, and or Then delete all the x-axis coordinates in the first image [0, x i ] or the y-axis coordinate is in [0,y j ]; if (x i ,0) or (0,y j ) is the last projection point on the coordinate axis, and or Then delete all the x-axis coordinates in the first image that are between [x i ,M] or the y-axis coordinate is [y j ,N] range of pixels;
[0026] The remaining pixels in the first image are used as the second image.
[0027] Further, the identifying the connected areas in the second image and removing the invalid areas to obtain the third image includes:
[0028] Determine a candidate center and an area of a connected region in the second image, and determine a fitting radius of the connected region according to the candidate center and the area of the connected region;
[0029] Determine the external offset ξ of the connected region according to the fitting radius of the connected region ij and the internal offset ξ′ ij ;
[0030] Set the external offset threshold Inward offset threshold and the first pixel number threshold ε1; when any pixel point corresponding to a connected area satisfies or If the number of pixels corresponding to the connected area is m1>ε1, the connected area is determined to be an invalid area and deleted to obtain the remaining connected area.
[0031] Set the second pixel number threshold ε2, when any pixel point corresponding to any remaining connected area satisfies or If the number of pixels corresponding to the connected area is m2<ε2, the connected area is determined to be an invalid area and deleted to obtain a third image.
[0032] A phytoplankton counting device, comprising:
[0033] at least one processor;
[0034] at least one memory for storing at least one program;
[0035] When the at least one program is executed by the at least one processor, the at least one processor implements the phytoplankton counting method as described in any one of the above.
[0036] A computer-readable storage medium stores a phytoplankton counting program, which, when executed by a processor, implements the steps of any one of the above-mentioned phytoplankton counting methods.
[0037] The beneficial effects of the present invention are as follows: the present invention discloses a phytoplankton counting method, device and readable storage medium. The present invention extracts an image of a slide sample of original phytoplankton liquid to obtain a microscopic image of the slide sample; pre-processes the microscopic image to obtain a first image; performs circular detection on the first image to obtain a circular area contained in the first image; performs center detection on the circular area contained in the first image to obtain a candidate center of the circular area contained in the first image; according to the candidate center of the first image, invalid pixels in the first image are eliminated to obtain a second image; connected areas in the second image are identified, and invalid areas are eliminated to obtain a third image; connected areas in the third image are identified to obtain phytoplankton counting results. The present invention improves the accuracy of marine phytoplankton cell counting by improving the recognition of image processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] 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 will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0039] Figure 1 1 is a schematic diagram of a flow chart of a method for counting phytoplankton in an embodiment of the present invention;
[0040] Figure 2 Schematic diagram of the structure of the phytoplankton counting device in the embodiment of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the embodiments and drawings to clearly and completely describe the concept, specific structure and technical effects of this application, so as to fully understand the purpose, scheme and effect of this application. It should be noted that the embodiments and features in the embodiments of this application can be combined with each other without conflict.
[0042] See also Figure 1 , Figure 1 This is a schematic diagram of a phytoplankton counting method provided in the present application, the method comprising the following steps:
[0043] Step S100, performing image extraction on a glass slide sample of the original phytoplankton liquid to obtain a microscopic image of the glass slide sample;
[0044] Step S200, preprocessing the microscopic image to obtain a first image; wherein the preprocessing includes: grayscale conversion, image enhancement and image denoising;
[0045] Step S300, performing circle detection on the first image to obtain a circular area contained in the first image; wherein the circle detection includes: image segmentation, morphological operation and edge detection;
[0046] Step S400, performing center detection on the circular area included in the first image to obtain a candidate center of the circular area included in the first image;
[0047] Specifically, a circular Hough transform algorithm is used, and the circular equation and gradient information after polar coordinate transformation are combined to establish two two-dimensional accumulators to perform center detection respectively, so as to obtain candidate centers of the circular area included in the first image.
[0048] Step S500, according to the candidate center of the first image, invalid pixels in the first image are eliminated to obtain a second image;
[0049] It should be noted that an invalid pixel point refers to a pixel point whose distance from any candidate circle center greatly exceeds the value range of the radius.
[0050] Step S600, identifying connected areas in the second image, removing invalid areas, and obtaining a third image;
[0051] After completing the candidate center detection, the radius corresponding to each candidate center is calculated, and the false circle is identified and removed by judging the relationship between some parameters set in the optimization operation and their corresponding thresholds.
[0052] Step S700: Identify the connected areas in the third image to obtain a phytoplankton counting result.
[0053] It should be noted that the present invention mainly performs texture analysis on round algae cells, which can effectively handle situations with a large number of cells or a large degree of cell adhesion, and solves the problem of phytoplankton cell counting in complex situations. The method of the present invention adopts digital image processing technology, which has the advantages of low cost, high work efficiency and high accuracy. The present invention can be used for rapid monitoring of actual algae, helps to provide phytoplankton information in water bodies in a timely manner, and can provide technical support for the prediction and early warning of phytoplankton blooms. The present invention adopts an image processing method to identify images that have been processed to remove redundant edges to obtain phytoplankton counting results.
[0054] As a further improvement of the above embodiment, in step S400, performing center detection on the circular area included in the first image to obtain a candidate center of the circular area included in the first image includes:
[0055] A circular Hough transform algorithm is used to detect the center of the circular area included in the first image to obtain a candidate center of the circular area included in the first image.
[0056] As a further improvement of the above embodiment, in step S500, removing invalid pixels in the first image according to the candidate center of the first image to obtain the second image includes:
[0057] Step S510, establishing an xy coordinate system for the first image, with the positive direction of the x-axis being from left to right and the positive direction of the y-axis being from top to bottom;
[0058] Step S520, recording the position information of each candidate center in the first image, and projecting the candidate center (xi, yi) onto the x-axis and y-axis respectively, and obtaining the coordinates of the two projection points as (xi, 0) and (0, yi) respectively; wherein the size of the first image is M×N, i=1, 2, ..., M, j=1, 2, ..., N;
[0059] Step S530, respectively calculating the distance between adjacent projection points on the x-axis and the y-axis; wherein, the distance between two adjacent projection points on the x-axis (x i ,0) and (x i+1 ,0) is dx i,i+1 =|x i+1 -x i |, two adjacent projection points on the y-axis (0,y j ) and (0,y j+1 ) is dy j,j+1 =|y j+1 -y j |;
[0060] Step S540: Determine a first distance threshold when In the first image, delete all the x-axis coordinates in [x i ,x i+1 ] within the range of pixels; when In the first image, delete all the y-axis coordinates in [y j ,y j+1 ] pixels within the range;
[0061] Step S550: for the first image, if (x i ,0) or (0,y j ) is the first projection point on the coordinate axis, and or Then delete all the x-axis coordinates in the first image [0, x i ] or the y-axis coordinate is in [0,y j ]; if (x i ,0) or (0,y j ) is the last projection point on the coordinate axis, and or Then delete all the x-axis coordinates in the first image that are between [x i ,M] or the y-axis coordinate is [y j ,N] range of pixels;
[0062] Step S560: Use the remaining pixels in the first image as the second image.
[0063] As a further improvement of the above embodiment, in step S600, the step of identifying the connected regions in the second image and removing invalid regions to obtain the third image includes:
[0064] Step S610, determining candidate centers and areas of connected regions in the second image, and determining a fitting radius of the connected region according to the candidate centers and areas of the connected region;
[0065] Step S620, determining the external offset ξ of the connected region according to the fitting radius of the connected region ij and the internal offset ξ′ ij ;
[0066] Step S630: Setting the external offset threshold Inward offset threshold and the first pixel number threshold ε1; when any pixel point corresponding to a connected area satisfies or If the number of pixels corresponding to the connected area is m1>ε1, the connected area is determined to be an invalid area and deleted to obtain the remaining connected area.
[0067] In this step, for any connected region, most of its pixels fall near the boundary; if there are a large number of pixels outside a connected region, it can be determined that it is an invalid region.
[0068] Step S640: set a second pixel number threshold ε2. When any pixel point corresponding to any remaining connected area satisfies or If the number of pixels corresponding to the connected area is m2<ε2, the connected area is determined to be an invalid area and deleted to obtain a third image.
[0069] In this step, if the number of corresponding pixels in any connected region is less than a certain value, the connected region is determined to be an invalid region.
[0070] Eight microscopic images were selected to conduct experiments using the method provided in this embodiment. The eight microscopic images include some images with a large number of phytoplankton and a complex background, as well as some images with a small number of phytoplankton and a simple background. The experimental data are shown in Table 1 below:
[0071] Table 1: Phytoplankton number identification statistics
[0072] Microscopic image number 1 2 3 4 5 6 7 8 Phytoplankton quantity 20 40 30 20 30 50 60 20 Test results 20 40 30 20 30 48 57 20 Number of missed detections 0 0 0 0 0 2 3 0 False positives 0 0 0 0 0 0 1 0 Accuracy 1 1 1 1 1 0.96 0.93 1
[0073] and Figure 1 Corresponding to the method, refer to Figure 2 An embodiment of the present application further provides a phytoplankton counting device 10 , wherein the device 10 includes a memory 11 , a processor 12 , and a computer program stored in the memory 11 and executable on the processor 12 .
[0074] The processor 12 and the memory 11 may be connected via a bus or other means.
[0075] The non-transitory software program and instructions required to implement the phytoplankton counting method of the above embodiment are stored in the memory 11 , and when executed by the processor 12 , the phytoplankton counting method of the above embodiment is executed.
[0076] and Figure 1 Corresponding to the method, an embodiment of the present application further provides a computer-readable storage medium, on which a phytoplankton counting program is stored. When the phytoplankton counting program is executed by a processor, the steps of the phytoplankton counting method described in any of the above embodiments are implemented.
[0077] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0078] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the phytoplankton counting system, and various interfaces and lines are used to connect various parts of the entire phytoplankton counting system operable device.
[0079] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the phytoplankton counting system by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart-Media-Card, SMC), a secure digital (Secure-Digital, SD) card, a flash card (Flash-Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0080] Although the description of the present application has been quite detailed and specifically describes several described embodiments, it is not intended to be limited to any of these details or embodiments or any particular embodiment, but should be regarded as providing a broad possible interpretation of these claims by reference to the attached claims, taking into account the prior art, so as to effectively cover the intended scope of the present application. In addition, the above description of the present application is based on the embodiments foreseeable by the inventor, and its purpose is to provide a useful description, and those non-substantial changes to the present application that have not yet been foreseen may still represent equivalent changes to the present application.
Claims
1. A method for counting phytoplankton, characterized in that: The method comprises the following steps: performing image extraction on a glass slide sample of the original phytoplankton liquid to obtain a microscopic image of the glass slide sample; Preprocessing the microscopic image to obtain a first image; Performing circle detection on the first image to obtain a circular area contained in the first image; Performing center detection on the circular area included in the first image to obtain a candidate center of the circular area included in the first image; Eliminate invalid pixels in the first image according to the candidate center of the first image to obtain a second image; Identify the connected areas in the second image, remove invalid areas, and obtain a third image; The connected areas in the third image are identified to obtain a phytoplankton counting result.
2. A phytoplankton counting method according to claim 1, characterized in that: The preprocessing of the microscopic image to obtain a first image comprises: Grayscale conversion, image enhancement and image denoising are performed on the microscopic image to obtain a first image.
3. A phytoplankton counting method according to claim 1, characterized in that: The performing circle detection on the first image to obtain a circular area contained in the first image includes: Perform image segmentation, morphological operation and edge detection on the first image to obtain a circular area included in the first image.
4. A phytoplankton counting method according to claim 1, characterized in that: The performing center detection on the circular area included in the first image to obtain a candidate center of the circular area included in the first image includes: A circular Hough transform algorithm is used to detect the center of the circular area included in the first image to obtain a candidate center of the circular area included in the first image.
5. A phytoplankton counting method according to claim 1, characterized in that: The step of removing invalid pixels in the first image according to the candidate center of the first image to obtain the second image includes: Establish an xy coordinate system for the first image, with the positive direction of the x-axis being from left to right and the positive direction of the y-axis being from top to bottom; Record the position information of each candidate center in the first image, and project the candidate center (xi, yi) onto the x-axis and y-axis respectively, and obtain the coordinates of the two projection points as (xi, 0) and (0, yi) respectively; wherein the size of the first image is M×N, i=1, 2, ..., M, j=1, 2, ..., N; Calculate the distance between adjacent projection points on the x-axis and y-axis respectively; among them, the distance between two adjacent projection points on the x-axis (x i ,0) and (x i+1 ,0) is dx i,i+1 =|x i+1 -x i |, two adjacent projection points on the y-axis (0,y j ) and (0,y j+1 ) is dy j,j+1 =|y j+1 -y j |; Determine the first distance threshold when In the first image, delete all the x-axis coordinates between [x i ,x i+1 ] within the range of pixels; when In the first image, delete all the y-axis coordinates in [y j ,y j+1 ] pixels within the range; For the first image, if (x i ,0) or (0,y j ) is the first projection point on the coordinate axis, and or Then delete all the x-axis coordinates in the first image [0, x i ] or the y-axis coordinate is in [0,y j ]; if (x i ,0) or (0,y j ) is the last projection point on the coordinate axis, and or Then delete all the x-axis coordinates in the first image that are between [x i ,M] or the y-axis coordinate is [y j ,N] range of pixels; The remaining pixels in the first image are used as the second image.
6. A phytoplankton counting method according to claim 1, characterized in that: The step of identifying the connected areas in the second image and removing invalid areas to obtain the third image includes: Determine a candidate center and an area of a connected region in the second image, and determine a fitting radius of the connected region according to the candidate center and the area of the connected region; Determine the external offset ξ of the connected region according to the fitting radius of the connected region ij and the internal offset ξ ij ′; Set the external offset threshold Inward offset threshold and the first pixel number threshold ε1; when any pixel point corresponding to a connected area satisfies or If the number of pixels corresponding to the connected area is m1>ε1, the connected area is determined to be an invalid area and deleted to obtain the remaining connected area. Set the second pixel number threshold ε2, when any pixel point corresponding to any remaining connected area satisfies or If the number of pixels corresponding to the connected area is m2<ε2, the connected area is determined to be an invalid area and deleted to obtain a third image.
7. A phytoplankton counting device, characterized in that: The device comprises: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the phytoplankton counting method according to any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a phytoplankton counting program, and when the phytoplankton counting program is executed by a processor, the steps of the phytoplankton counting method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Cell counting method based on key point detection
CN110136065A
Phytoplankton counting method and device
CN114004823A
