A micro-plastic intelligent identification and measurement method based on machine vision

By using machine vision-based image processing and cluster analysis methods, the automated identification and measurement of microplastics has been achieved, solving the problems of low identification efficiency and poor automation in existing technologies, and providing an efficient and intelligent microplastic detection solution.

CN121214432BActive Publication Date: 2026-07-31CHANGJIANG RIVER SCI RES INST CHANGJIANG WATER RESOURCES COMMISSION
View PDF 7 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHANGJIANG RIVER SCI RES INST CHANGJIANG WATER RESOURCES COMMISSION
Filing Date
2025-09-10
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies for microplastic identification and measurement suffer from problems such as low identification efficiency, reliance on manual labor, poor automation, poor model generalization ability, insufficient training data, difficulty in applying to the analysis of complex mixtures, and expensive or destructive equipment.

Method used

A machine vision-based approach is adopted to achieve automatic identification, counting, length and area measurement of microplastic particles through image acquisition, background extraction, image difference, image binarization, clustering segmentation and morphological measurement. This includes image preprocessing, connected clustering and image calibration measurement, thus constructing a fully automated detection method.

Benefits of technology

It achieves efficient, automatic, and intelligent microplastic identification and measurement, improves identification accuracy and robustness, has strong adaptability, reduces training data and equipment costs, and is suitable for monitoring various aquatic environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121214432B_ABST
    Figure CN121214432B_ABST
Patent Text Reader

Abstract

This invention discloses a machine vision-based intelligent identification and measurement method for microplastics, comprising: filtering water samples containing and without microplastics; acquiring images using a microscope at a uniform magnification to obtain a microplastic test image and a control image; calculating the absolute value of the color centroid value of the control image and the color difference between the microplastic image, generating a difference image, and performing denoising, grayscale conversion, and binarization processing to obtain a binary image highlighting the microplastics; extracting the pixel coordinates of the microplastics, setting a threshold for connected clustering, and combining a preset microplastic identification threshold to distinguish microplastics from image impurities, thereby achieving microplastic identification and quantity statistics; further capturing images of a standard objective micrometer, calculating the actual physical size represented by a single pixel, and automatically calculating the area and length of the microplastics by combining the bounding rectangle of each cluster with the number of pixels. This invention offers accurate identification and a high degree of automation, and can be widely applied to the intelligent identification and analysis of microplastics in water bodies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of environmental monitoring and machine vision intelligent recognition technology, specifically a machine vision-based intelligent recognition and measurement method for microplastics, applicable to the identification and statistical analysis of microplastics in the environment. Background Technology

[0002] Microplastic pollution has become a significant threat to global water safety and ecosystem health. Microplastics are plastic particles with a diameter of less than 5 millimeters, originating from sources such as the breakage of aging plastic products, microbeads added to personal care products, and fibers generated during textile washing. Microplastics are small, diverse, and widely distributed, and readily absorb harmful pollutants from the environment. They can enter the human body through the food chain, posing potential risks to ecological security and human health. Identifying and measuring microplastics is a crucial foundation for environmental monitoring, water remediation, pollution source tracing, and ecological risk assessment.

[0003] Currently, microplastic identification and measurement mainly employ laboratory analytical methods, including manual microscopy, Fourier transform infrared spectroscopy (FTIR), Raman spectroscopy, and thermal desorption-gas chromatography-mass spectrometry (Py-GC / MS). Among these, manual microscopy is cumbersome, subjective, and inefficient; while FTIR and Raman spectroscopy offer high accuracy, their pretreatment is complex, requiring high sample purity, making them unsuitable for analyzing complex mixtures in natural water bodies, and they are also expensive and time-consuming. Py-GC / MS offers high sensitivity but cannot provide particle-level morphological information and is destructive to the sample, making it unsuitable for studies requiring the preservation of original microplastic morphology information.

[0004] To improve recognition efficiency and measurement accuracy, researchers have recently attempted to introduce intelligent methods such as image recognition and machine learning to assist in the rapid identification and classification of microplastics. Patent CN119399754A discloses an intelligent identification method for the quantity and type of microplastics based on machine vision learning. This patent obtains the quantity and morphological characteristics of microplastics through experiments or other related methods, processes this information to form a database of typical microplastic features, introduces machine learning and YOLO algorithms to construct a basic recognition model, and establishes an efficient, fast, convenient, and low-cost intelligent quantitative method for the quantity of microplastics. Patent CN118351113B discloses an intelligent identification, positioning, and size calculation system for microplastics based on artificial intelligence. This patent uses SVMD and SO-SloEn's S-RNS feature extraction method to extract features from preprocessed data, uses the KPE-YOLOv5 algorithm to determine the boundaries and shapes of microplastic particles, and performs accurate bounding box positioning and shape segmentation of microplastic particles, thereby achieving accurate identification of microplastic particles. Patent CN118865035A discloses an automatic image acquisition and intelligent recognition system for microplastic particles. The system consists of three parts: a high-definition autofocus microscope, a two-axis programmable motion control system, and a single-stage target detection model. The microscope can automatically focus on the microplastic filter membrane sample, and the filter membrane sample is moved by the two-axis programmable motion control system to acquire a complete image of the microplastic filter membrane. The obtained image is further processed by the single-stage target detection model, which uses a preset deep learning algorithm to automatically identify microplastics in the image, thereby identifying microplastic particles in both fibrous and blocky forms and achieving automated counting. Patent CN119251817B discloses an intelligent detection method and system for microplastic pollutants based on image recognition. This patent involves sequentially introducing different numbers of microplastic particles into a measured water body, obtaining grayscale images of the water body after each introduction, obtaining the number of grayscale levels and the number of pixels in each grayscale level based on the grayscale histogram, calculating the total grayscale value, obtaining the total grayscale value corresponding to each order of magnitude of microplastic particles, establishing a fitting function to fit the relationship between the total grayscale value and the order of magnitude of microplastic particles, obtaining the total grayscale value of the polluted water body to be tested, substituting the total grayscale value into the fitting function, and obtaining the corresponding order of magnitude of microplastic particles. Patent CN116563768B discloses an intelligent detection method and system for microplastic contaminants. This patent constructs the aggregation ambiguity coefficient of the channel image by analyzing the aggregation complexity and aggregation richness data of microplastic contaminants in the channel image, obtains the prior signal-to-noise ratio of the blocks in the RGB image of microplastic contaminants, preprocesses the RGB image of microplastic contaminants based on Wiener filtering according to the prior signal-to-noise ratio, obtains the grayscale image of microplastic contaminants, and uses a CNN convolutional neural network model to input the grayscale image of microplastic contaminants to identify microplastic contaminants.

[0005] Existing technologies use convolutional neural networks (CNNs) for automatic identification and classification of microplastic images, or extract parameters such as particle size, color, and shape through image processing techniques for type identification. However, these intelligent identification methods still suffer from problems such as poor model generalization ability, limited identification of microplastic types, insufficient training data, and difficulty in integrating with actual sampling and preprocessing processes. Therefore, there is an urgent need for an automated method based on machine vision technology that requires no large amount of training data and can achieve intelligent identification and quantitative measurement of microplastics, in order to improve detection efficiency and accuracy and provide a scientific basis for environmental protection and pollution source tracing. Summary of the Invention

[0006] The purpose of this invention is to provide a machine vision-based intelligent identification and measurement method for microplastics. Through image acquisition, background extraction, image differencing, image binarization, clustering and segmentation, and morphological measurement, it can automatically identify, count, measure the length and area of ​​microplastic particles in a sample, thus solving the problem of intelligent identification and statistics of microplastics in the environment.

[0007] The technical solution adopted in this invention is as follows:

[0008] A machine vision-based intelligent identification and measurement method for microplastics includes the following steps:

[0009] The first step is image data acquisition: the collected water samples containing microplastics and those without microplastics are filtered separately. After the filter membranes are dried, the microscope is adjusted to a clear field of view so that the morphology of microplastics can be clearly identified. Then, the control software is used to take an image of the filter membrane containing microplastics as the test image, and an image of the filter membrane without microplastics is taken at the same magnification as the control image.

[0010] The second step is microplastic image preprocessing: Based on the control image generated in the first step, the centroid value of the RGB color values ​​of the control image is obtained. Based on the test image generated in the first step, the absolute value of the difference between the centroid values ​​of the RGB color values ​​of the test image and the control image is calculated. A difference image is generated based on the absolute value. The difference image is then subjected to denoising, grayscale processing and binarization segmentation to obtain a binarized image that highlights the microplastics.

[0011] The third step is microplastic clustering identification and statistics: Extract the pixel coordinates of the binarized image obtained in the second step, filter the pixel coordinates that are consistent with the pixel values ​​of microplastics to form a microplastic pixel coordinate set, set a connectivity clustering threshold, and perform connectivity clustering on the microplastic pixel coordinate set by iteratively calculating the distance between pixels. Based on the number of pixels in each cluster and combined with the preset microplastic identification threshold, the microplastics in the image are identified, and the clustered pixel coordinate sets corresponding to multiple microplastics and the number of pixels in each cluster are obtained. The number of microplastics is then counted.

[0012] Step 4: Automatic calculation of microplastic features: Adjust the microscope to the same magnification as in Step 1, take an image of the objective micrometer, calculate the ratio of the actual length of the objective micrometer to the number of its corresponding pixels to obtain the actual physical size represented by a single pixel, iteratively calculate the product of the number of pixels in each cluster and the actual physical area of ​​a single pixel to obtain the actual area of ​​each microplastic; determine the minimum bounding rectangle of each cluster based on the pixel coordinate set, calculate the ratio of the actual physical area of ​​the minimum bounding rectangle to the actual area of ​​the microplastic it defines, combine the preset cluster shape discrimination threshold to determine the shape of the microplastic, and calculate its length.

[0013] Furthermore, the first step includes the following steps:

[0014] Step 1.1, Microplastic water sample filtration: For the collected water sample containing microplastics, after shaking well, take out a portion and filter the water sample using a vacuum filtration device and filter membrane A. Replace with a new filter membrane B of the same specification and filter the water sample treated by filter membrane A in the same way.

[0015] Step 1.2, Microplastic Image Acquisition: After drying, filter membrane A is placed under a microscope. The microscope is adjusted to clearly display the microplastics. Using the microscope's software, an image of the filter membrane containing microplastics is acquired as the image to be tested.

[0016] Step 1.3, control image acquisition: After drying the filter membrane B, place it under a microscope and, using the microscope software at the same magnification as in Step 1.2, acquire an image of the filter membrane without microplastics as a control image.

[0017] Furthermore, the second step includes the following steps:

[0018] Step 2.1, Acquisition of control image data: Read the control image without microplastics acquired in Step 1.3, and obtain the three-dimensional matrix data of the RGB values ​​of the control image in m rows and n columns;

[0019] Step 2.2, Centroid Calculation of Comparison Image Data: The three-dimensional matrix data is converted into a two-dimensional matrix of comparison image data with mn rows and 3 columns in order from left to right and top to bottom. The mean of the RGB values ​​in the mn rows is calculated as the centroid value of the RGB color values ​​of the comparison image. , , );

[0020] Step 2.3, Microplastic Image Differential Calculation: Read the test image containing microplastics acquired in Step 1.2 to obtain the three-dimensional matrix data of RGB values ​​of the test image in M ​​rows and N columns. Convert the three-dimensional matrix data into two-dimensional matrix data of the test image in the same way as in Step 2.2, and then compare the centroid values ​​of the two-dimensional matrix data of the test image with the RGB color values ​​of the control image. , , The absolute value of the difference between the two is used as the microplastic difference image matrix data. , , );

[0021] Step 2.4, Image Denoising Processing: Determine a Gaussian filter kernel, perform convolution operation on the microplastic difference image, and take the weighted average of the neighboring pixels of a certain pixel as the new value of the pixel to form the denoised microplastic image;

[0022] Step 2.5, Image Binarization Processing: The denoised microplastic image generated in Step 2.4 is converted to grayscale to obtain a grayscale image. The grayscale image is then binarized using a binarization method to obtain a binarized image that highlights the microplastics.

[0023] Furthermore, the third step includes the following steps:

[0024] Step 3.1, Extract microplastic pixel coordinates: Read the binarized image generated in step 2.5, extract the pixel coordinates and pixel value of each pixel, and form a two-dimensional matrix of pixel coordinates and pixel values. , , ), Traverse the two-dimensional matrix data, extract the pixel coordinates that are the same as the microplastic pixel values, and form a microplastic pixel coordinate set ( , );

[0025] Step 3.2, Image Connectivity Clustering: Set the connectivity distance threshold dis for the microplastic pixel coordinate set ( , Perform the following iterations:

[0026] Take any set of values ​​( , The data is placed into matrix a, and the remaining data is placed into a temporary matrix temp.

[0027] Iteratively calculate the Euclidean distance between all coordinates in matrix a and all coordinates in temporary matrix temp, and move the coordinates with a distance ≤ dis from matrix temp to matrix a;

[0028] Repeat the above process until the coordinates in matrix a no longer increase, and record the number of coordinates in matrix a, which is the number of pixels in this cluster;

[0029] Step 3.3, Microplastic Count Statistics: Repeat the connected clustering operation on the remaining coordinates of the matrix temp from Step 3.2 to generate multiple clusters and their respective pixel counts. Compare with the preset microplastic identification threshold k, and identify clusters with pixel counts ≥ k as microplastics, and those with pixel counts < k as impurities. This yields the cluster pixel coordinate set of n microplastics and their corresponding pixel counts, i.e., the count of n microplastics.

[0030] Furthermore, the fourth step includes the following steps:

[0031] Step 4.1, take a picture of the micrometer: Place the standard objective micrometer under a microscope with the same magnification as in Step 1.2, and take a picture containing the objective micrometer;

[0032] Step 4.2, Calculation of pixel size: Extract the number of pixels corresponding to the objective micrometer, and calculate the actual physical size represented by a single pixel in the image by combining the size marked on the objective micrometer.

[0033] Step 4.3, Microplastic Area Calculation: Based on the n microplastics and their corresponding pixel counts obtained in Step 3.3, iteratively calculate the product of the number of pixels corresponding to each microplastic and the actual area represented by a single pixel to obtain the actual area of ​​the microplastic.

[0034] Step 4.4, Clustered Pixel Boundary Rectangle: For any microplastic clustered pixel coordinate set generated in Step 3.3, traverse its coordinate information, calculate the minimum and maximum values ​​of the x-coordinates and y-coordinates of all points, and determine the minimum bounding rectangle containing all pixels.

[0035] Step 4.5, Microplastic shape determination: Based on the minimum bounding rectangle of the clustered pixels obtained in Step 4.4 and the actual physical size represented by a single pixel, calculate the actual physical area of ​​the minimum bounding rectangle. Then calculate the ratio of the actual physical area of ​​the minimum bounding rectangle to the actual area of ​​the microplastic it defines. If the ratio is greater than or equal to the preset clustering shape determination threshold t, the microplastic is determined to be an inclined elongated microplastic; otherwise, the microplastic is determined to be a horizontal or vertical elongated microplastic, or a near-circular microplastic.

[0036] Step 4.6, Calculation of microplastic length:

[0037] For oblique elongated microplastics: the actual length of the microplastic = the length of the diagonal pixels of the smallest bounding rectangle × the actual physical size represented by a single pixel;

[0038] For horizontal or vertical elongated microplastics or near-circular microplastics: the actual length of the microplastic = the length of the longest side of the smallest circumscribed rectangle × the actual physical size represented by a single pixel.

[0039] This invention provides a machine vision-based intelligent identification and measurement method for microplastics. Based on image processing, image differencing, pixel clustering analysis, and image calibration measurement techniques, it constructs a fully automated microplastic detection method from sample preprocessing and image recognition to size calculation. This provides a practical and feasible technical solution for the efficient, automated, intelligent, and accurate identification and measurement of microplastics, and has the following beneficial effects:

[0040] (1) This invention proposes a machine vision-based intelligent identification and measurement method for microplastics, aiming to solve the problems of low identification efficiency, reliance on manual labor, and poor automation in existing microplastic detection technologies. This invention achieves automatic identification, statistics, and measurement of microplastic image clustering through image processing technology and supervised machine learning algorithms. It has advantages such as high identification accuracy, strong adaptability, and no need for a large number of samples and expensive instruments, and is suitable for microplastic monitoring tasks in various aquatic environments.

[0041] (2) This invention collects filter membrane images of water samples containing microplastics and those without microplastics, uses the centroid difference of RGB color values ​​to perform differential enhancement on the images, and combines image denoising, grayscale conversion and binarization segmentation algorithms to effectively eliminate background interference and improve the saliency of microplastic targets, thereby improving the accuracy and robustness of subsequent identification and solving the problem of sensitivity to different lighting conditions and filter membrane background in traditional image methods.

[0042] (3) In the image recognition stage, this invention introduces a clustering algorithm based on connectivity and Euclidean distance to cluster pixels with similar color features and spatial proximity, thereby achieving accurate extraction of microplastic image regions. By setting a recognition threshold to distinguish microplastics from image impurities, the number of microplastics can be automatically counted without manual intervention, significantly improving the intelligence and batch processing capabilities of image processing, and effectively avoiding the error of judging the target region based on human experience in traditional methods;

[0043] (4) In the microplastic measurement stage, this invention uses a standard objective micrometer for image calibration. By calculating the ratio coefficient between pixels and actual length, the identified microplastic clusters and pixel counts are converted into actual physical areas and lengths, thus realizing fully automatic and quantitative measurement of microplastic size information. This method has high measurement accuracy, is easy to operate, and is suitable for batch data processing, significantly improving the efficiency and consistency of microplastic area and length measurement.

[0044] (5) The present invention adopts a modular design, which separates the image acquisition, preprocessing, recognition and measurement steps to achieve process standardization and universality. The parameters can be flexibly adjusted according to factors such as microscope magnification, filter membrane material and microplastic type. It is suitable for laboratory environment and on-site monitoring scenario. It has good recognition ability and adaptability for microplastics of different types, colors and shapes.

[0045] (6) The identification and measurement process constructed in this invention has been programmed to achieve fully automated operation, and is suitable for batch detection by image processing software or microscope systems. Combined with the automatic image acquisition system and the identification algorithm of this patent, unattended microplastic detection tasks can be realized, significantly improving analysis efficiency, reducing labor costs and operating thresholds, and enhancing the intelligence level of microplastic monitoring. It can be widely applied to the detection and assessment of microplastics in various water environments such as drinking water sources, lakes, reservoirs, rivers, and sewage treatment plants, providing efficient, reliable, and scalable technical support for water microplastic pollution monitoring and risk management. Attached Figure Description

[0046] Figure 1 This is a schematic diagram illustrating the process principle of a machine vision-based intelligent identification and measurement method for microplastics according to an embodiment of the present invention.

[0047] Figure 2 This is a flowchart of a machine vision-based intelligent identification and measurement method for microplastics according to an embodiment of the present invention;

[0048] Figure 3 This is a schematic diagram illustrating the results of each step in the processing of a machine vision-based intelligent identification and measurement method for microplastics according to an embodiment of the present invention.

[0049] Figure 4 This is a graph showing the error between the intelligent identification length and the measured length of microplastics in an embodiment of the present invention.

[0050] Figure 5 This is a graph showing the error between the intelligent microplastic identification area and the measured area in an embodiment of the present invention. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0052] This invention utilizes technologies such as machine vision, image processing, connected clustering, image calibration, and morphological measurement. Based on the principles of digital image processing and target recognition, the acquired target image is processed through differential calculation, denoising, grayscale conversion, and binarization to highlight the microplastic region. Pixel coordinates are extracted and connected clustering is performed. Microplastics are identified and their quantity is counted based on the cluster size. Finally, by calibrating the actual pixel size and calculating the bounding rectangle and pixel count, the area and length of each microplastic are obtained.

[0053] The technical solution of the present invention will be further described in detail below with reference to specific examples and accompanying drawings.

[0054] Please see Figure 1 , Figure 2 and Figure 3 This invention provides a machine vision-based intelligent identification and measurement method for microplastics, comprising the following steps:

[0055] Step 1: Image Data Acquisition

[0056] (1) Filtration of water samples containing microplastics: A water sample containing microplastics was collected from a reservoir. After shaking, a portion of the sample was filtered using a vacuum filtration device and filter membrane A. A new filter membrane B of the same specification was then used to filter the water sample treated by filter membrane A in the same way.

[0057] (2) Microplastic image acquisition: After drying, filter membrane A is placed under a microscope. The microscope is adjusted to clearly display the microplastics. Using the microscope's software, images of the filter membrane containing microplastics are acquired as the images to be tested (e.g., Figure 3 (as shown in (a)).

[0058] (3) Image acquisition for control: After drying, filter membrane B is placed under a microscope and the image of the filter membrane without microplastics is acquired using the microscope software at the same magnification as a control image.

[0059] Step 2: Microplastic Image Preprocessing

[0060] (1) Acquisition of control image data: The control images without microplastics were read using the Python third-party library OpenCV to obtain the 1636-row, 1088-column RGB three-dimensional matrix data of the control images;

[0061] (2) Centroid calculation of the reference image data: The three-dimensional matrix data is converted into a two-dimensional matrix data of the reference image with 1779968 rows and 3 columns in order from left to right and from top to bottom. The mean of the RGB values ​​of the 1779968 rows is calculated as the centroid value of the RGB color value of the reference image (228, 232, 184).

[0062] (3) Microplastic image difference calculation: Read the acquired image containing microplastics to be tested, and obtain the 1636-row, 1088-column RGB three-dimensional matrix data of the image to be tested. Convert the three-dimensional matrix data into a 1779968-row, 3-column two-dimensional matrix data of the image to be tested in a left-to-right and top-to-bottom manner. The absolute value of the difference between the two-dimensional matrix data of the image to be tested and the centroid value (228, 232, 184) of the RGB color values ​​of the control image is taken as the microplastic difference image matrix data. , , ), totaling 1636 rows and 1088 columns (difference image as shown) Figure 3 (as shown in (b)).

[0063] (4) Image denoising: Determine a Gaussian filter kernel, perform convolution operation on the microplastic difference image, and take the weighted average of the neighboring pixels of a certain pixel as the new value of the pixel to form the denoised microplastic image;

[0064] (5) Image binarization processing: The generated denoised microplastic image is subjected to grayscale calculation to obtain a grayscale image (in this embodiment, a weighted average is used to convert the RGB image to a grayscale image (e.g., Figure 3 As shown in (c), with weights of 0.299, 0.587, and 0.114 respectively, a binarization method is used to binarize the grayscale image (in this embodiment, a fixed threshold binarization method is used, with the threshold set to 100), resulting in a binarized image highlighting the microplastics (as shown in [example]). Figure 3 (as shown in d).

[0065] Step 3: Microplastic Clustering Identification and Statistics

[0066] (1) Extracting microplastic pixel coordinates: Read the binarized image, extract the pixel coordinates and pixel values ​​of each pixel, and form a two-dimensional matrix of pixel coordinates and pixel values. , , ), Traverse the two-dimensional matrix data, extract the pixel coordinates that are the same as the microplastic pixel values, and form a microplastic pixel coordinate set ( , );

[0067] (2) Image connectivity clustering: Set the connectivity distance threshold dis=50 for the microplastic pixel coordinate set ( , Perform the following iterations:

[0068] Take any set of values ​​( , The data is placed into matrix a, and the remaining data is placed into a temporary matrix temp.

[0069] Iteratively calculate the Euclidean distance between all coordinates in matrix a and all coordinates in temporary matrix temp, and move coordinates with a distance ≤ 50 from matrix temp to matrix a;

[0070] Repeat the above process until the coordinates in matrix a no longer increase. Record the number of coordinates in matrix a, which is the number of pixels in the cluster. This step is implemented through programming.

[0071] (3) Microplastic Quantity Statistics: Repeatedly perform connected clustering operations on the remaining coordinates of matrix temp to generate multiple clusters and their respective pixel counts. Set the microplastic identification threshold k=55, and classify clusters with a pixel count ≥55 as microplastics, and those with a pixel count <55 as impurities. Thus, obtain the cluster pixel coordinate sets of n=5 microplastics and their corresponding pixel counts, which are 66, 141, 688, 9249, and 48445 respectively (e.g. Figure 3 As shown in (e), n=5 microplastics were obtained through statistics, and this step was implemented through programming.

[0072] Step 4: Automatic Calculation of Microplastic Features

[0073] (1) Take a picture of the micrometer: Place the standard objective micrometer under a microscope with the same magnification and take a picture of the objective micrometer.

[0074] (2) Calculation of pixel size: Using Photoshop image processing software, the number of pixels corresponding to the objective lens micrometer is extracted. Combined with the size marked on the objective lens micrometer, the actual physical size represented by a single pixel in the image is calculated. In this embodiment, the actual physical size represented by a single pixel is calculated to be 0.5586. ;

[0075] (3) Calculation of microplastic area: Based on the n=5 microplastics and the number of their corresponding pixels, the actual area of ​​the microplastic is calculated by iteratively multiplying the number of pixels corresponding to each microplastic by the actual area represented by a single pixel. The actual areas are 20.5942, 43.9968, 214.6793, 2886.0021, and 15116.4852, respectively. ;

[0076] (4) Clustered pixel bounding rectangle: For any generated microplastic clustered pixel coordinate set, traverse its coordinate information, calculate the minimum and maximum values ​​of the horizontal coordinates of all points, as well as the minimum and maximum values ​​of the vertical coordinates, and determine the minimum bounding rectangle containing all pixels.

[0077] (5) Microplastic shape discrimination: Based on the minimum bounding rectangle of the obtained clustered pixels and the actual physical size represented by a single pixel, the actual physical area of ​​the minimum bounding rectangle is calculated. The ratio of the actual physical area of ​​the minimum bounding rectangle to the actual area of ​​the microplastic it is bounded by is calculated again. If the ratio is greater than or equal to the preset clustering shape discrimination threshold t=2, the microplastic is determined to be an inclined elongated microplastic. Otherwise, the microplastic is determined to be a horizontal or vertical elongated microplastic, or a near-circular microplastic.

[0078] (6) Calculation of microplastic length: Calculate the length of microplastic based on the determined shape of microplastic. If the microplastic is an oblique elongated microplastic, then the actual length of the microplastic = the length of the diagonal pixel of the minimum bounding rectangle × the actual physical size represented by a single pixel.

[0079] For horizontally or vertically elongated microplastics or near-circular microplastics: the actual length of the microplastic = the length of the longest side of the smallest bounding rectangle × the actual physical size represented by a single pixel. The lengths of all microplastics were iteratively calculated and found to be 6.1446, 8.9376, 22.9026, 69.8250, and 158.0838 respectively. (like Figure 3 (as shown in (f)).

[0080] Case Study

[0081] To verify the effectiveness and applicability of the intelligent microplastic identification and measurement method described in this invention, in addition to the examples, multiple sets of water samples were selected from a reservoir as implementation samples for actual testing, and the identification accuracy and measurement precision of the method of this invention were comprehensively evaluated.

[0082] According to the steps of the method of this invention, multiple images of the filter membrane containing microplastics at the same magnification are prepared using a vacuum filtration device and a microscope. Combined with the previously acquired images of the filter membrane without microplastics, the microplastic pixel coordinates are extracted from the binary images after image difference calculation, image denoising, grayscale conversion, and binarization processing, and then connected component clustering is performed. Similarly, a connectivity threshold of 50 and a recognition threshold of 55 are set, ultimately identifying multiple effective microplastic clusters. Based on the set cluster shape discrimination threshold 2, statistical analysis is performed to calculate the area and length of each microplastic.

[0083] To verify the recognition accuracy of this invention, the sample microplastics were manually measured using microscope processing software. The obtained length and area were compared with the automatic measurement results of this invention. Statistical analysis showed that the average relative error for length calculation was approximately 2.0%, and the average relative error for area calculation was less than 1%, demonstrating that this invention has high recognition accuracy and measurement precision. The above results are as follows: Figure 4 and Figure 5 As shown, this demonstrates the effectiveness and practicality of the present invention in microplastic image recognition and measurement.

[0084] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A machine vision-based intelligent identification and measurement method for microplastics, characterized by: Includes the following steps: The first step is image data acquisition: the collected water samples containing microplastics and those without microplastics are filtered separately. After the filter membranes are dried, the microscope is adjusted to a clear field of view so that the morphology of microplastics can be clearly identified. Then, the control software is used to take an image of the filter membrane containing microplastics as the test image, and an image of the filter membrane without microplastics is taken at the same magnification as the control image. The second step is microplastic image preprocessing: Based on the control image generated in the first step, the centroid value of the RGB color values ​​of the control image is obtained. Based on the test image generated in the first step, the absolute value of the difference between the centroid values ​​of the RGB color values ​​of the test image and the control image is calculated. A difference image is generated based on the absolute value. The difference image is then subjected to denoising, grayscale processing and binarization segmentation to obtain a binarized image that highlights the microplastics. The third step is microplastic clustering identification and statistics: Extract the pixel coordinates of the binarized image obtained in the second step, filter the pixel coordinates that are consistent with the pixel values ​​of microplastics to form a microplastic pixel coordinate set, set a connectivity clustering threshold, and perform connectivity clustering on the microplastic pixel coordinate set by iteratively calculating the distance between pixels. Based on the number of pixels in each cluster and combined with the preset microplastic identification threshold, the microplastics in the image are identified, and the clustered pixel coordinate sets corresponding to multiple microplastics and the number of pixels in each cluster are obtained. The number of microplastics is then counted. Step 4: Automatic calculation of microplastic features: Adjust the microscope to the same magnification as in Step 1, take an image of the objective micrometer, calculate the ratio of the actual length of the objective micrometer to the number of its corresponding pixels to obtain the actual physical size represented by a single pixel, iteratively calculate the product of the number of pixels in each cluster and the actual physical area of ​​a single pixel to obtain the actual area of ​​each microplastic; determine the minimum bounding rectangle of each cluster based on the pixel coordinate set, calculate the ratio of the actual physical area of ​​the minimum bounding rectangle to the actual area of ​​the microplastic it defines, combine it with the preset cluster shape discrimination threshold to determine the shape of the microplastic, and calculate its length; The first step includes the following steps: Step 1.1, Microplastic water sample filtration: For the collected water sample containing microplastics, after shaking well, take out a portion and filter the water sample using a vacuum filtration device and filter membrane A. Replace with a new filter membrane B of the same specification and filter the water sample treated by filter membrane A in the same way. Step 1.2, Microplastic Image Acquisition: After drying, filter membrane A is placed under a microscope. The microscope is adjusted to clearly display the microplastics. Using the microscope's software, an image of the filter membrane containing microplastics is acquired as the image to be tested. Step 1.3, control image acquisition: After drying the filter membrane B, place it under a microscope and, using the microscope software at the same magnification as in Step 1.2, acquire an image of the filter membrane without microplastics as a control image. The second step includes the following steps: Step 2.1, Acquisition of control image data: Read the control image without microplastics acquired in Step 1.3, and obtain the three-dimensional matrix data of the RGB values ​​of the control image in m rows and n columns; Step 2.2, Centroid Calculation of Comparison Image Data: The three-dimensional matrix data is converted into a two-dimensional matrix of comparison image data with mn rows and 3 columns in order from left to right and top to bottom. The mean of the RGB values ​​in the mn rows is calculated as the centroid value of the RGB color values ​​of the comparison image. , , ); Step 2.3, Microplastic Image Differential Calculation: Read the test image containing microplastics acquired in Step 1.2 to obtain the three-dimensional matrix data of RGB values ​​of the test image in M ​​rows and N columns. Convert the three-dimensional matrix data into two-dimensional matrix data of the test image in the same way as in Step 2.2, and then compare the centroid values ​​of the two-dimensional matrix data of the test image with the RGB color values ​​of the control image. , , The absolute value of the difference between the two is used as the microplastic difference image matrix data. , , ); Step 2.4, Image Denoising Processing: Determine a Gaussian filter kernel, perform convolution operation on the microplastic difference image, and take the weighted average of the neighboring pixels of a certain pixel as the new value of the pixel to form the denoised microplastic image; Step 2.5, Image Binarization Processing: The denoised microplastic image generated in Step 2.4 is converted to grayscale to obtain a grayscale image. The grayscale image is then binarized using a binarization method to obtain a binarized image highlighting the microplastics. The third step includes the following steps: Step 3.1, Extract microplastic pixel coordinates: Read the binarized image generated in step 2.5, extract the pixel coordinates and pixel value of each pixel, and form a two-dimensional matrix of pixel coordinates and pixel values. , , ), Traverse the two-dimensional matrix data, extract the pixel coordinates that are the same as the microplastic pixel values, and form a microplastic pixel coordinate set ( , ); Step 3.2, Image connected clustering: Set a connected distance threshold dis, and for the set of microplastic pixel coordinates (X, Y)T , ) perform the following iteration: Take any set of values ​​( , The data is placed into matrix a, and the remaining data is placed into a temporary matrix temp. Iteratively calculate the Euclidean distance between all coordinates in matrix a and all coordinates in temporary matrix temp, and move the coordinates with a distance ≤ dis from matrix temp to matrix a; Repeat the above process until the coordinates in matrix a no longer increase, and record the number of coordinates in matrix a, which is the number of pixels in this cluster; Step 3.3, Microplastic Count Statistics: Repeat the connected clustering operation on the remaining coordinates of the matrix temp from Step 3.2 to generate multiple clusters and their respective pixel counts. Compare with the preset microplastic identification threshold k, and identify clusters with pixel counts ≥ k as microplastics, and those with pixel counts < k as impurities. This yields the cluster pixel coordinate set of n microplastics and their corresponding pixel counts, i.e., the count of n microplastics.

2. The machine vision-based intelligent identification and measurement method for microplastics as described in claim 1, characterized in that: The fourth step includes the following steps: Step 4.1, take a picture of the micrometer: Place the standard objective micrometer under a microscope with the same magnification as in Step 1.2, and take a picture containing the objective micrometer; Step 4.2, Calculation of pixel size: Extract the number of pixels corresponding to the objective micrometer, and calculate the actual physical size represented by a single pixel in the image by combining the size marked on the objective micrometer. Step 4.3, Microplastic Area Calculation: Based on the n microplastics and their corresponding pixel counts obtained in Step 3.3, iteratively calculate the product of the number of pixels corresponding to each microplastic and the actual area represented by a single pixel to obtain the actual area of ​​the microplastic. Step 4.4, Clustered Pixel Boundary Rectangle: For any microplastic clustered pixel coordinate set generated in Step 3.3, traverse its coordinate information, calculate the minimum and maximum values ​​of the x-coordinates and y-coordinates of all points, and determine the minimum bounding rectangle containing all pixels. Step 4.5, Microplastic shape determination: Based on the minimum bounding rectangle of the clustered pixels obtained in Step 4.4 and the actual physical size represented by a single pixel, calculate the actual physical area of ​​the minimum bounding rectangle. Then calculate the ratio of the actual physical area of ​​the minimum bounding rectangle to the actual area of ​​the microplastic it defines. If the ratio is greater than or equal to the preset clustering shape determination threshold t, the microplastic is determined to be an inclined elongated microplastic; otherwise, the microplastic is determined to be a horizontal or vertical elongated microplastic, or a near-circular microplastic. Step 4.6, Calculation of microplastic length: For oblique elongated microplastics: the actual length of the microplastic = the length of the diagonal pixels of the smallest bounding rectangle × the actual physical size represented by a single pixel; For horizontal or vertical elongated microplastics or near-circular microplastics: the actual length of the microplastic = the length of the longest side of the smallest circumscribed rectangle × the actual physical size represented by a single pixel.