Microalgae density measurement method based on image color correction

By combining image color correction and polynomial fitting function with color correction algorithm, the problem of background color and light influence in microalgae density measurement is solved, achieving high accuracy and stability measurement under multiple algal species and multiple density conditions, and simplifying the sample preparation process.

CN120997315AInactive Publication Date: 2025-11-21GUANGDONG OCEAN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511098366.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-06
Publication Date
2025-11-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing methods for measuring microalgae density are easily affected by background color and ambient light, leading to reduced measurement accuracy. Furthermore, different methods have limited applicability and are difficult to adapt to conditions involving multiple algal species and densities.

Method used

A microalgae density measurement method based on image color correction was adopted. By calculating the deviation of the color values ​​of each component (red, green, and blue) from the zero microalgae density sample, the relationship between the color vector and microalgae density was established using a polynomial fitting function. Combined with offset correction, scaling correction, and linear correction algorithms, the image color deviation was corrected. Experimental data was managed through a multidimensional matrix to optimize experimental conditions.

Benefits of technology

It improves the accuracy and stability of microalgae density measurement, is applicable to multiple algae species and multiple density conditions, simplifies the sample preparation process, reduces human operation errors, and ensures the reliability and practicality of experimental results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120997315A_ABST
    Figure CN120997315A_ABST
Patent Text Reader

Abstract

The invention discloses a microalgae density measurement method based on image color correction, which comprises the following steps: providing stable illumination by using an LED panel light source under a pure white background, collecting images of microalgae samples with different densities, and constructing a color difference-density model of microalgae images; extracting the RGB average value of the whole image and calculating the weighted combination chromatic aberration of the RGB average value and the ideal white color; the method comprises the following steps: selecting a plurality of pure color backgrounds with different colors and different materials, collecting microalgae sample images, and setting a zero-density microalgae sample as a reference standard for correcting system errors; the image is processed through a color correction algorithm, chromatic aberration offset caused by the background is compensated, and the microalgae image approximates to the expression under the pure white background in a color space; according to the method, the influence of background color on the microalgae image can be corrected, the detection process is simplified, the accuracy and reliability of microalgae density measurement are improved, and the method is suitable for microalgae density monitoring under various environmental conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of optical measurement, and specifically relates to a method for measuring microalgae density based on image color correction. Background Technology

[0002] In the field of microalgae cultivation, traditional methods for accurately and quickly detecting the content of microalgae particles include dry weight method, ultrasonic detection method, counting method, and electrode method. The dry weight method involves placing a certain volume of suspension in a high-speed centrifuge for solid-liquid centrifugation. The separated precipitate is washed several times, centrifuged again, and then the centrifuged particles are dried at high temperature. The dried particles are then placed in a constant-weight, dry weighing bottle, and the mass of the separated particles is measured. Finally, the particle content is calculated. The counting method is commonly used to detect cell numbers using a cell counter or methylene blue staining. This method requires microscopic observation and counting, and multiple sample dilutions, which may lead to significant errors. The ultrasonic method for detecting concentration works by the absorption of sound waves by the particles when ultrasound passes through the suspension. This causes the ultrasonic energy to attenuate and the amplitude to decrease, resulting in changes in sound intensity, velocity, or acoustic impedance before and after the ultrasonic wave incident. The concentration is related to these changes in ultrasound intensity, and the density of the suspended particles can be measured based on this principle. However, such instruments are susceptible to changes in the composition of the fermentation broth, bubbles, temperature variations, and viscosity. The electrode method is a standard electrochemical detection method that uses changes in capacitance between electrodes to measure the concentration of particles in a suspension. However, this method is typically used to detect the number of live cells and still has limitations in detecting all types of granular suspended microalgae.

[0003] With the rapid development of optical detection technology, optical information analysis is increasingly widely used in detecting the density of suspended particles. Currently, the optical characteristics used to detect microalgae density include photometer detection, fiber optic detection, photoelectric detector detection, and image detection. However, there are some limitations in the research on measuring microalgae density using optical methods: (1) The test process is lengthy. Traditional microalgae density testing involves multiple steps such as sampling, detection, calculation, information transmission, and storage. When faced with a large number of samples, data confusion is likely to occur, and the entire process is quite complicated. (2) It is susceptible to interference from stray light. During the test, stray light in the external environment can easily affect the test results. (3) Fluctuations in test equipment parameters lead to errors. For example, focusing errors under different test scenarios can reduce the accuracy of the test. (4) Differences in optical properties between microalgae species cause errors. Since the differences in optical performance between different microalgae species are often ignored, existing evaluation methods may not be applicable to various test environments. (5) Different methods test different ranges of microalgae density. Some methods cannot characterize microalgae culture media with low or high density, and lack representativeness. In conclusion, developing a real-time, flexible, and highly reliable method for testing microalgae density is of great significance for large-scale microalgae cultivation and real-time measurement and monitoring. Summary of the Invention

[0004] This invention provides a microalgae density measurement method based on image color correction, which can solve the problem that the accuracy of microalgae density measurement in the prior art is affected by background color and external ambient light.

[0005] To solve the above problems, the technical solution provided by the present invention is as follows:

[0006] This invention provides a method for measuring microalgae density based on image color correction, the method comprising the following steps:

[0007] Step 1: Prepare microalgae samples of different species and density gradients, and test the density of the microalgae samples using both traditional manual counting and image color recognition methods.

[0008] Step 2: Process the discrete data of R, G, and B values ​​of the images obtained under different microalgae densities. Calculate the deviation of the color values ​​of each red, green, and blue component from the zero microalgae density sample, and use a polynomial fitting function to establish the relationship between the color vector and the microalgae density, thereby obtaining the mathematical fitting formula between the color vector and the microalgae density.

[0009] Step 3: Under background conditions of different colors, color gradients, roughness, and brightness, acquire microalgae images and calculate the color deviation of the images;

[0010] Step 4: Introduce three color correction algorithms—offset correction, proportional correction, and linear correction—to the color deviation of the image calculated in Step 3. Correct the color deviation of the acquired image and substitute the corrected color components into the mathematical fitting formula in Step 2 to recalculate the color difference of the microalgae image.

[0011] Step 5: Using the image color difference obtained in Step 4, deduce the value of microalgae density in reverse and analyze the image color difference-microalgae density relationship curve;

[0012] Step 6: Calculate the accuracy and stability of the microalgae density measurement in Step 5 under different test conditions, adjust the experimental scheme and conditions to reduce systematic errors, and conduct closed-loop analysis and improvement of the experimental test method.

[0013] In an optional embodiment of the present invention, step 1 specifically includes:

[0014] Step 11: Select F types of microalgae for density measurement, and prepare T types of microalgae samples with density gradients, placing them in microalgae solution bottles; the sampling method for microalgae samples is as follows: prepare i samples of the same algae species and the same density as one group (i = 1, 2, 3, ...); microalgae samples of different densities have visual color gradations; change the algae species and use the same method to prepare samples for the F types of microalgae; use the traditional manual counting method to calibrate the density of all microalgae samples, and obtain the density matrix D. F×T This indicates that the elements in the matrix include d. 1,1 d 1,2 、…、d F,T A dataset of artificially counted microalgae densities; mathematically, D∈Z F×T The density D of microalgae samples obtained by manual counting is an F×T matrix, where Z is the matrix symbol. The average density and density error are calculated for i microalgae samples of the same species and density. By changing the algae species and density, the average density and error of the F×T groups of microalgae samples under different species and density conditions are finally obtained. In the above data, the average microalgae density is represented by a matrix D. A D A ∈Z F ×T The microalgae error is represented by a matrix D. E D E ∈Z F×T Save data;

[0015] Step 12: Select an LED flat panel lamp (2) with any luminous color, color temperature, and uniform luminous intensity, and fix its luminous brightness; fix the position of the guide rail (7) on the experimental table, and fix the LED flat panel lamp (2) below the guide rail (7) to provide bottom illumination for the microalgae solution bottle (1); fix the back plate (3), color card (4), and transparent frosted plate (5) with the fixer (6), and further fix them at a specific position on the guide rail (7) so that the light emitted by the LED flat panel lamp (2) can cover the periphery of the back plate (3);

[0016] Step 13: Place the microalgae solution bottle (1) on the LED flat panel light (2) so that the light emitted by the LED flat panel light (2) passes through the bottom of the microalgae solution bottle (1) and fix the microalgae solution bottle (1) in the middle position in front of the back plate (3).

[0017] Step 14: Use the bracket (9) to place and fix the color recognizer (8) in front of the microalgae solution bottle (1), ensuring that the color recognition area of ​​the color recognizer (8) is located in the center of the microalgae solution bottle (1), and ensuring that the color recognition area is aligned with the area containing the microalgae solution.

[0018] Step 15: Connect the color recognizer (8) to the image processing device (10) and connect the LED flat panel light (2) to the power supply (11); under different background colors and LED flat panel light (2) brightness parameters, change different microalgae solution bottles (1) to collect color information of different microalgae samples, save and record them in the image processing device (10).

[0019] In an optional embodiment of the present invention, step 2 specifically includes:

[0020] The color recognizer (8) analyzes the image colors of different microalgae samples, obtains the red, green, and blue (R, G, B) values ​​corresponding to different microalgae images, and saves them to the image processing device (10); it processes the discrete data of R, G, and B values ​​of the images obtained under different microalgae densities; among them, the deviation ΔR between the color value of the red component (R) and the ideal zero microalgae density sample (R0, G0, B0) is ΔR = R0 - R, the deviation ΔG between the color value of the green component (G) and the zero microalgae density sample (R0, G0, B0) is ΔG = G0 - G, and the deviation ΔB between the color value of the blue component (B) and the zero microalgae density sample (R0, G0, B0) is ΔB = B0 - B;

[0021] The following formula is used to fit the mathematical relationship between the color vector and the density of the microalgae solution:

[0022] d=f(ΔR,ΔG,ΔB)=∑ i+j+k≤n c ijk ΔR i ΔG jΔB k (1);

[0023] Where f(ΔR,ΔG,ΔB) is the fitted function, c refers to the weighting coefficients for different measurement times, i, j, k represent the subscripts of c and the powers of R, G, B, and n is the maximum order of the polynomial; compared with the Euclidean distance color difference calculation method in color space, this formula retains more of the directional information of the original vector and has more flexible nonlinear modeling capabilities, which can achieve higher color difference-microalgae density fitting accuracy; the expanded form of formula (1) is as follows:

[0024] d = f(ΔR, ΔG, ΔB) = c 200 ΔR 2 +c 110 ΔRΔG+c 101 ΔRΔB+c 020 ΔG 2 +c 011 ΔGΔB+c 002 ΔB 2 (2).

[0025] In an optional embodiment of the present invention, step 3 specifically includes:

[0026] Prepare color charts of M different color series, including red, yellow, green, blue, and purple, labeled C1, C2, ..., C60. M Each color series has N color gradients; therefore, the color chart for the Mth color can be labeled as C. M1 C M2 ..., C MN The different color gradients and color swatches of the entire series can be represented as a two-dimensional matrix: C∈Z M ×N , specifically,

[0027]

[0028] Prepare roughness values ​​S1, S2, ..., S I For I different roughness frosted plates, their matrix representation is: S∈Z I , specifically,

[0029]

[0030] The frosted plate (5) is placed and fixed in front of the color chart (4) to change the roughness of the microalgae imaging background; then the entire color chart with different color series and different roughness can be represented as the following matrix:

[0031]

[0032] Specifically, in, The symbols represent the interaction between different color series and roughness color cards, indicating the process by which these cards work together to affect the background color of a microalgae sample. Furthermore, the interaction is illustrated by different background brightness levels L1, L2, ..., L... J Under the condition (i.e., L∈R) J Microalgae samples of different densities, D1, D2, ..., D, were selected. K (i.e., D∈Z) K Using color charts of different color series and roughness as backgrounds, the color of microalgae solutions was individually identified. Through experimental testing, the color deviation obtained from the measured microalgae images can be generally represented as Δ(R). O G O B O The expression for ) is as follows:

[0033] Δ(R O G O B O )=g(C M,N ,S I ,L J ,d)+ε (5);

[0034] Formula (5) shows that the actual observed color deviation Δ(R) O G O B O The effect is influenced by the color of the color chart (C), the roughness of the frosted plate (S), the light intensity (L), the microalgae density (d), and the systematic error (ε); the functional expression of g() is:

[0035]

[0036] Specifically, Therefore, Δ(R) O G O B O The final result can be expressed as matrix Z. 3 means, specifically,

[0037]

[0038] In an optional embodiment of the present invention, step 4 specifically includes:

[0039] Three color optimization algorithms—offset correction, scaling correction, and linear correction—are introduced to correct color shifts in the acquired images. Specifically, the offset correction steps are as follows: Using a 0-density microalgae sample (D0), a background brightness of L1, and a color chart of pure white (C... 00 Under the condition that the background roughness is 0 (S0), the measured image color is compared with that of an ideal pure white card (C).00 The color difference between the two is used to obtain the color offset (R). offset G offset B offset That is, the offset (R) offset G offset B offset ) indicates that, under conditions without color components, each component is relative to the ideal pure white (C). 00 The color offset value of the microalgae image is used to correct the error caused by the background color offset; the specific calculation is as follows:

[0040]

[0041] Where i represents the i-th sample group; the color differences of the actually observed red, green, and blue components are represented by ΔR. O (i), ΔG O (i), ΔB O (i) The corrected color differences of the red, green, and blue components are expressed as ΔR. C (i), ΔG C (i), ΔB C (i);

[0042] The steps for proportional correction are as follows: Under standard white conditions, measure the proportional deviation of each color component relative to the ideal value to obtain the gain coefficient (G). R G G G B These coefficients are used to scale images with color differences, thereby adjusting color intensity; in the scaling correction method, ΔR C (i), ΔG C (i), ΔB C (i) is represented as follows:

[0043]

[0044] Among them, G R G G G B It is based on the ideal pure white (C 00 The gain coefficients of each component (R, G, B) are calculated using the color ratio of the pure white card used in the actual test; the color difference ΔR of the red, green, and blue components is then used as the actual observed color difference. O (i), ΔG O (i), ΔB O (i) Multiply by G R G G G B It can adjust the brightness and color intensity of each component to correct image scaling deviations;

[0045] The steps of linear correction are as follows: Linear correction is based on offset correction and scaling correction, taking into account two factors: the gain factor of different color components and the color offset; specifically, the original color difference is multiplied by the scaling deviation (G). R G G G B Then, by adding a color offset (R) offset G offset B offset A linear transformation is performed on the original image; in the linear correction method, the corrected color component ΔR C (i), ΔG C (i), ΔB C (i) is represented as follows:

[0046]

[0047] Among them, (G) R G G G B ) is the gain coefficient of the three color components, (R) offset G offset B offset ) represents the offset of the three color components; the correction process first adjusts the color intensity and then corrects the color offset, thereby more effectively correcting color errors in the image.

[0048] In an optional embodiment of the present invention, step 6 specifically includes: selecting background brightness L1, L2, ..., L... J Using a light source, the microalgae samples were tested under different conditions of color card color (C), frosted plate roughness (S), light intensity (L), and microalgae density (d) according to steps 2 to 5, and the observed color component ΔR was obtained. O (i), ΔG O (i), ΔB O (i), and then corrected to obtain the color component ΔR C (i), ΔG C (i), ΔB C (i). The color component ΔR C (i), ΔG C (i), ΔB C (i) Substitute into formula (2) and calculate multiple times to obtain the microalgae density test set matrix D. Total D Total It is a multidimensional matrix, i.e., D Total ∈Z i×K×T×M×N×I×J ;

[0049] Compare D under different conditions: color (C) of different color charts, roughness (S) of the frosted board, and light intensity (L). Total ∈Zi×K×T×M×N×I×J The microalgae density test set matrix D obtained by manual counting method M The differences were analyzed, and the average accuracy was calculated. Specifically, the conditions for color card color (C), frosted plate roughness (S), and light intensity (L) were changed one by one, and the microalgae density measurement matrix D was selected. Total The matrix D corresponds to a series of microalgae density values ​​d obtained under specific conditions and the microalgae density test set matrix D obtained by manual counting method. M The accuracy of a specific microalgae density (d) condition is calculated by comparing all the d values ​​and using the following formula.

[0050]

[0051] At a specific microalgae density (d), the accuracy is the absolute value of the difference between the microalgae density obtained by the manual counting method and the microalgae density obtained by this method, divided by the microalgae density obtained by the manual counting method. This accuracy is higher than 0 and lower than 1. If it is close to 0, it indicates a large error, and if it is close to 1, it indicates a small error.

[0052] The above method was used to analyze the microalgae density test set matrix D obtained by the manual counting method. M The parameters are calculated one by one; furthermore, the average accuracy can be calculated using one of the following methods:

[0053] With the parameters of roughness (S), light intensity (L), and microalgae density (d) of the fixed frosted plate, the average accuracy was calculated under different color card (C) conditions.

[0054] With fixed parameters of color card color (C), frosted board roughness (S), and microalgae density (d), the average accuracy was calculated under different light intensities (L).

[0055] (3) With fixed parameters of light intensity (L), color card color (C), and microalgae density (d), calculate the average accuracy under different frosted board roughness (S) conditions; (4) With fixed parameters of light intensity (L), color card color (C), and frosted board roughness (S), calculate the average accuracy under different microalgae density (d) conditions.

[0056] Analyze the calculation results and observe the D in the microalgae density average matrix. A The range of all values ​​is determined by the microalgae error matrix D. E The standard deviation was calculated to analyze the reliability of the microalgae density test results. For the microalgae density (d) measurement with low average accuracy, the experimental scheme and experimental conditions were adjusted to reduce systematic errors. The test and calculation were repeated to conduct closed-loop analysis and improve the experimental test method.

[0057] Compared with existing technologies, this invention provides a method for measuring microalgae density based on image color correction, which has the following advantages:

[0058] (1) In terms of testing methods, a mathematical relationship fitting method based on color deviation and microalgae solution density is proposed. By calculating the deviation of the color values ​​of each component of red, green and blue from the zero microalgae density sample, and using a polynomial fitting function to establish the relationship between color vector and microalgae density, a quantitative conversion from image color information to microalgae density is realized, providing a new technical means for non-invasive microalgae density measurement.

[0059] (2) In terms of testing methods, it overcomes the limitations of traditional single algal species or density calibration methods, and provides standardized datasets under multiple algal species and multiple density conditions, laying a data foundation for the subsequent establishment of color-density models and improving the universality and accuracy of density measurement.

[0060] (2) In terms of calculation methods, three color optimization algorithms—offset correction, proportional correction, and linear correction—were introduced to correct color offsets in the acquired images. These algorithms can effectively correct image color errors caused by factors such as background color offset and uneven lighting, improving the accuracy and reliability of microalgae image color measurement and providing higher quality data for subsequent density analysis.

[0061] (3) In terms of calculation method, a multidimensional matrix is ​​used to represent and process the microalgae density test set data. Multiple factors such as color card color, frosted plate roughness, light intensity, and microalgae density are incorporated into the matrix system, realizing efficient data management and analysis under complex experimental conditions. By comparing the microalgae density test set matrix under different conditions with the matrix obtained by manual counting, the influence of each factor on density measurement can be accurately evaluated, and the corresponding average accuracy rate can be calculated, providing a quantitative basis for optimizing experimental conditions.

[0062] (4) In terms of testing methods, microalgae samples of the same species and density are configured into i groups according to the visual color gradient, and density error analysis is combined to achieve gradient sample management. The density difference is intuitively reflected by the color gradient, which simplifies the sample configuration and identification process, reduces human operation error, and improves calibration efficiency.

[0063] (5) Regarding the testing method, a closed-loop analysis and improvement experimental strategy is proposed. Based on the calculated average accuracy, the experimental scheme and conditions are adjusted for microalgae density conditions with large measurement errors to reduce systematic errors, and then retesting and calculating are performed. This strategy can continuously optimize the experimental method, improve the accuracy and stability of microalgae density measurement, and ensure the reliability and practicality of the experimental results.

[0064] (6) The testing system is a modular experimental device integrating LED flat panel lights, guide rails, backplate, color cards, frosted plates, and color recognizers, supporting flexible adjustment of illumination uniformity, background color, and roughness. The device has a simple and expandable structure, is suitable for rapid testing of different algal species and environmental conditions, and has good potential for engineering applications. Attached Figure Description

[0065] To more clearly illustrate the technical solutions in the embodiments or prior art, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0066] Figure 1 This is a schematic diagram of the overall structure of a microalgae density measurement system based on image color correction, provided in an embodiment of this application.

[0067] Figure 2 This is a partial structural schematic diagram of a microalgae density measurement system based on image color correction, provided in an embodiment of this application.

[0068] Figure 3 This is a flowchart illustrating an implementation method for measuring microalgae density based on image color correction, provided in this application.

[0069] Figure 4 The relationship between microalgae density and R-channel color values ​​obtained under the test conditions of selecting a purple background and green algae is shown in the embodiments of this application.

[0070] Figure 5 The relationship between microalgae density and G-channel color values ​​obtained under the test conditions of purple background and green algae provided in the embodiments of this application is shown.

[0071] Figure 6 The relationship between microalgae density and B-channel color values ​​obtained under the test conditions of purple background and green algae provided in the embodiments of this application is shown.

[0072] Figure 7 The relationship between microalgae density and R-channel color values ​​obtained under test conditions of green background and brown algae provided in the embodiments of this application.

[0073] Figure 8 The relationship between microalgae density and G-channel color values ​​obtained under the test conditions of green background and brown algae provided in the embodiments of this application is shown.

[0074] Figure 9The relationship between microalgae density and B-channel color values ​​obtained under the test conditions of green background and brown algae provided in the embodiments of this application is shown.

[0075] Figure 10 The relationship between microalgae density and R-channel color values ​​under different brightness levels was obtained by selecting a white background and brown algae as test conditions in the embodiments of this application.

[0076] Figure 11 The relationship between microalgae density and G-channel color values ​​under different brightness levels was obtained by selecting a white background and brown algae as test conditions in the embodiments of this application.

[0077] Figure 12 The relationship between microalgae density and B-channel color values ​​under different brightness levels was obtained by selecting a white background and brown algae as test conditions in the embodiments of this application.

[0078] Figure 13 The method for selecting offset correction provided in this application and the relationship between microalgae density and G-channel color values ​​obtained under the test condition of brown algae are described.

[0079] Figure 14 The selection ratio correction method provided in the embodiments of this application and the relationship between microalgae density and G channel color values ​​obtained under the test condition of brown algae.

[0080] Figure 15 The linear correction method and the relationship between microalgae density and G-channel color values ​​obtained under the test conditions of brown algae provided in the embodiments of this application are selected.

[0081] Figure 16 The density measurement accuracy obtained under the test conditions of selecting a linear correction method and green algae in the embodiments of this application. Detailed Implementation

[0082] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0083] like Figure 1As shown, this embodiment of the invention provides a microalgae density measurement system based on image color correction, including a microalgae solution bottle 1, a white LED light panel 2, a back plate 3, a color card 4, a frosted plate 5, a fixture 6, a guide rail 7, a color recognizer 8, a bracket 9, an image processing device 10, and a power supply 11. The transparent microalgae solution bottle 1 is 40 mm wide, 20 mm long, and has a wall thickness of 2 mm, used to hold microalgae solutions of different densities and algae species. The microalgae solution bottle 1 is placed on the LED flat panel light 2, so that the light emitted by the LED flat panel light 2 passes through the bottom of the microalgae solution bottle 1. The LED flat panel light 2 is connected to the power supply 11. By adjusting the driving current of the power supply 11, the LED flat panel light 2 can provide ambient light of different brightness to the microalgae solution bottle 1. By changing the color of the LED flat panel light 2, different colors of ambient light can be provided to the microalgae solution bottle 1. The elongated guide rail 7 is placed tightly against the LED flat panel light 2, and the back plate 3 is fixed inside the elongated guide rail 7 by adjusting screws. Keep the backplate 3 perpendicular to the LED flat panel light 2, and place the color card 4 and frosted plate 5 in front of the backplate 3. The color card 4 provides various colored backgrounds for shooting during the color recognition of the microalgae solution. The frosted plate 5 is used to add different roughness to the backgrounds of different colors, serving as a shooting background. Use the fixture 6 to fix the color card 4 and frosted plate 5 to the backplate 3 to prevent slippage. Fix the position of the guide rail 7 to fix the overall position of the backplate 3, color card 4, transparent frosted plate 5, and fixture 6. Place the color recognizer 8 close to the front of the microalgae solution bottle 1, fix the position of the color recognizer 8, and use it for color recognition of the microalgae solution. Use the bracket 9 to fix the color recognizer 8 and adjust it to a suitable measurement height. Connect the image processing device 10 to the color recognizer 8 and control the color recognizer 8 to perform real-time testing and acquire color parameters. Store the data, analyze the color parameter change patterns obtained under different conditions through the image processing device 10, and derive the measured value of microalgae density.

[0084] This invention provides a method for measuring microalgae density based on image color correction, implemented using a microalgae density measurement system based on image color correction as described in the above embodiments, and includes the following steps:

[0085] Step 1: Prepare microalgae samples of different species and density gradients, and test the density of the microalgae samples using both traditional manual counting and image color recognition methods.

[0086] Step 2: Process the discrete data of R, G, and B values ​​of the images obtained under different microalgae densities. Calculate the deviation of the color values ​​of each red, green, and blue component from the zero microalgae density sample, and use a polynomial fitting function to establish the relationship between the color vector and the microalgae density, thereby obtaining the mathematical fitting formula between the color vector and the microalgae density.

[0087] Step 3: Under background conditions of different colors, color gradients, roughness, and brightness, acquire microalgae images and calculate the color deviation of the images;

[0088] Step 4: Introduce three color correction algorithms—offset correction, proportional correction, and linear correction—to the color deviation of the image calculated in Step 3. Correct the color deviation of the acquired image and substitute the corrected color components into the mathematical fitting formula in Step 2 to recalculate the color difference of the microalgae image.

[0089] Step 5: Using the image color difference obtained in Step 4, deduce the value of microalgae density in reverse and analyze the image color difference-microalgae density relationship curve;

[0090] Step 6: Calculate the accuracy and stability of the microalgae density measurement in Step 5 under different test conditions, adjust the experimental scheme and conditions to reduce systematic errors, and conduct closed-loop analysis and improvement of the experimental test method.

[0091] Step 1 specifically includes:

[0092] Step 11: Select F types of microalgae for density measurement, and prepare T types of microalgae samples with density gradients, placing them in microalgae solution bottles; the sampling method for microalgae samples is as follows: prepare i samples of the same algae species and the same density as one group (i = 1, 2, 3, ...); microalgae samples of different densities have visual color gradations; change the algae species and use the same method to prepare samples for the F types of microalgae; use the traditional manual counting method to calibrate the density of all microalgae samples, and obtain the density matrix D. F×T This indicates that the elements in the matrix include d. 1,1 d 1,2 、…、d F,T A dataset of artificially counted microalgae densities; mathematically, D∈Z F×T The density D of microalgae samples obtained by manual counting is an F×T matrix, where Z is the matrix symbol. The average density and density error are calculated for i microalgae samples of the same species and density. By changing the algae species and density, the average density and error of the F×T groups of microalgae samples under different species and density conditions are finally obtained. In the above data, the average microalgae density is represented by a matrix D. A D A ∈Z F ×T The microalgae error is represented by a matrix D. E D E ∈Z F×T Save data;

[0093] In this embodiment, two microalgae species were selected for density measurement, and six microalgae samples with density gradients were prepared and placed in microalgae solution bottles. The sampling method for the microalgae samples was as follows: three samples of the same species and density were prepared as one group; microalgae samples of different densities exhibited a visual color gradient. When the algae species were changed, the same method was used to prepare samples for both species; the density of all microalgae samples was calibrated using the traditional manual counting method, and the density was obtained using a density matrix D. 2×6 This indicates that the elements in the matrix include d. 1,1 d 1,2 、…、d 2,6 This is a dataset of artificially counted microalgae densities. Mathematically, D∈Z 2×6 That is, the density D of the microalgae sample obtained by manual counting is a 2×6 matrix, where Let D be a matrix notation. For three microalgae samples of the same algal species and under the same microalgae density conditions, the average density and density error were calculated. Then, by changing the algal species and density, the average microalgae density and error for the F×T group under different algal species and density conditions were finally obtained. In the above data, the average microalgae density is represented by the matrix D. A D A ∈Z 2×6 The microalgae error is represented by a matrix D. E D E ∈Z 2×6 Save the data.

[0094] Step 12: Select an LED flat panel light 2 with any emission color, color temperature, and uniform emission, and fix its emission brightness; fix the position of the guide rail 7 on the experimental table, and fix the LED flat panel light 2 below the guide rail 7 to provide bottom illumination for the microalgae solution bottle 1; fix the back plate 3, color card 4, and transparent frosted plate 5 with the fixer 6, and further fix them to a specific position on the guide rail 7 so that the light emitted by the LED flat panel light 2 can cover the periphery of the back plate 3;

[0095] Step 13: Place the microalgae solution bottle 1 on the LED flat panel light 2 so that the light emitted by the LED flat panel light 2 passes through the bottom of the microalgae solution bottle 1 and fix the microalgae solution bottle 1 in the middle position in front of the back plate 3.

[0096] Step 14: Use the bracket 9 to place and fix the color recognizer 8 in front of the microalgae solution bottle 1, ensuring that the color recognition area of ​​the color recognizer 8 is located in the center of the microalgae solution bottle 1, and ensuring that the color recognition area is aligned with the area containing the microalgae solution.

[0097] Step 15: Connect the color recognizer 8 to the image processing device 10 and connect the LED flat panel light 2 to the power supply 11; under different background colors, LED flat panel light 2 brightness and other parameter conditions, change different microalgae solution bottles 1, collect color information of different microalgae samples, save and record them in the image processing device 10.

[0098] Step 2 specifically includes:

[0099] Color recognizer 8 analyzes the image colors of different microalgae samples, obtains the red, green, and blue (R, G, B) values ​​corresponding to different microalgae images, and saves them to image processing device 10; it also processes the discrete data of R, G, and B values ​​of images obtained under different microalgae densities. Specifically, the deviation ΔR between the red component (R) color value and the ideal zero-microalgae density sample (R0, G0, B0) is ΔR = R0 - R; the deviation ΔG between the green component (G) color value and the zero-microalgae density sample (R0, G0, B0) is ΔG = G0 - G; and the deviation ΔB between the blue component (B) color value and the zero-microalgae density sample (R0, G0, B0) is ΔB = B0 - B.

[0100] The following formula is used to fit the mathematical relationship between the color vector and the density of the microalgae solution:

[0101] d=f(ΔR,ΔG,ΔB)=∑ i+j+k≤n c ijk ΔR i ΔG j ΔB k (1);

[0102] Where f(ΔR,ΔG,ΔB) is the fitted function, c refers to the weighting coefficients for different measurement times, i, j, k represent the subscripts of c and the powers of R, G, B, and n is the maximum order of the polynomial; compared with the Euclidean distance color difference calculation method in color space, this formula retains more of the directional information of the original vector and has more flexible nonlinear modeling capabilities, which can achieve higher color difference-microalgae density fitting accuracy; the expanded form of formula (1) is as follows:

[0103] d = f(ΔR, ΔG, ΔB) = c 200 ΔR 2 +c 110 ΔRΔG+c 101 ΔRΔB+c 020 ΔG 2 +c 011 ΔGΔB+c 002 ΔB 2 (2).

[0104] Step 3 specifically includes:

[0105] Prepare color charts of M different color series, including red, yellow, green, blue, and purple, labeled C1, C2, ..., C60. M Each color series has N color gradients. Therefore, the color chart for the Mth color can be labeled C. M1 C M2 ..., C MN The different color gradients and color swatches of the entire series can be represented as a two-dimensional matrix: C∈Z M ×N , specifically,

[0106]

[0107] Prepare roughness values ​​S1, S2, ..., S I For I different roughness frosted plates, their matrix representation is: S∈Z I , specifically,

[0108]

[0109] A frosted plate is placed and fixed in front of the color chart to change the roughness of the microalgae imaging background; then the entire color chart with different color series and different roughness can be represented as the following matrix:

[0110]

[0111] Specifically, in, The symbols represent the interaction relationships; for example, the matrix above uses the ◎ symbol to indicate the process by which color cards of different color series and roughnesses work together to affect the background color of a microalgae sample. Further, different background brightness levels L1, L2, ..., L... J Under the condition (i.e., L∈R) J Microalgae samples of different densities, D1, D2, ..., D, were selected. K (i.e., D∈Z) K Using color charts of different color series and roughness as backgrounds, the color of microalgae solutions was individually identified. Through experimental testing, the color deviation obtained from the measured microalgae images can be generally represented as Δ(R). O G O B O The expression for ) is as follows:

[0112] Δ(R O G O B O )=g(C M,N ,S I ,L J ,d)+ε (5);

[0113] Formula (5) shows that the actual observed color deviation Δ(R) O G O B O The effect is influenced by the color of the color chart (C), the roughness of the frosted plate (S), the light intensity (L), the microalgae density (d), and the systematic error (ε). The functional expression of g() is:

[0114]

[0115] Specifically,

[0116]

[0117] Therefore, Δ(R) O G O B O The final result can be expressed as matrix Z. 3 means, specifically,

[0118]

[0119] This embodiment prepares color charts for five different color series: red, yellow, green, blue, and purple, labeled C1, C2, ..., C5. Each color series has five color gradients; therefore, the fifth color chart can be labeled C... 51 C 52 ..., C 55 The different color gradients and color swatches in the entire series can be represented as a two-dimensional matrix: C∈Z 5×5 , specifically,

[0120]

[0121] Prepare three different roughness plates with roughnesses S1, S2, and S3, whose matrix representation is: S∈Z 3 , specifically,

[0122]

[0123] A frosted plate is placed and fixed in front of the color chart to change the roughness of the background in the microalgae image. The entire color chart with different color series and different roughness can then be represented as the following matrix:

[0124]

[0125] Specifically, in, The symbols represent the interaction relationships; for example, the matrix above uses the ◎ symbol to indicate the process by which color cards of different color series and roughnesses work together to affect the background color of a microalgae sample. Furthermore, this is illustrated under different background brightness conditions L1, L2, and L3 (i.e., L∈Z). 3 Microalgae samples of different densities, D1, D2, ..., D6 (i.e., D∈Z), were selected. 6 Using color charts of different color series and roughness as backgrounds, the color of the microalgae solution was individually identified. Through experimental testing, the color deviation obtained from the measured microalgae images can be generally represented as Δ(R). O G O B O The expression for ) is as follows:

[0126] Δ(R O G O B O )=g(C M,N ,S I ,L J ,d)+ε (5).

[0127] Formula (5) shows that the actual observed color deviation Δ(R) O G O B O The effect is influenced by the color of the color chart (C), the roughness of the frosted plate (S), the light intensity (L), the microalgae density (d), and the systematic error (ε). The functional expression of g() is:

[0128]

[0129] Specifically,

[0130]

[0131] Therefore, Δ(R) O G O B O The final result can be expressed as matrix Z. 3 means, specifically,

[0132]

[0133] Step 4 specifically includes:

[0134] Three color optimization algorithms—offset correction, scaling correction, and linear correction—are introduced to correct color shifts in the acquired images. Specifically, the offset correction steps are as follows: Using a 0-density microalgae sample (D0), a background brightness of L1, and a color chart of pure white (C... 00 Under the condition that the background roughness is 0 (S0), the measured image color is compared with that of an ideal pure white card (C).00 The color difference between the two is used to obtain the color offset (R). offset G offset B offset That is, the offset (R). offset G offset B offset ) indicates that, under conditions without color components, each component is relative to the ideal pure white (C). 00 The color offset value of the microalgae image is used to correct the error caused by the background color offset. In this embodiment, the background brightness is preferably 2.68 microwatts. The specific calculation is as follows:

[0135]

[0136] Where i represents the i-th sample group; the color differences of the actually observed red, green, and blue components are represented by ΔR. O (i), ΔG O (i), ΔB O (i) The corrected color differences of the red, green, and blue components are expressed as ΔR. C (i), ΔG C (i), ΔB C (i).

[0137] The steps for proportional correction are as follows: Under standard white conditions, measure the proportional deviation of each color component relative to the ideal value to obtain the gain coefficient (G). R G G G B These coefficients are used to scale images with color differences, thereby adjusting color intensity. In the scaling correction method, ΔR... C (i), ΔG C (i), ΔB C (i) is represented as follows:

[0138]

[0139] Among them, G R G G G B It is based on the ideal pure white (C 00 The gain coefficients of each component R, G, and B are calculated using the color ratio of the pure white card used in the actual test. This is achieved by using the observed color difference ΔR between the red, green, and blue components. O (i), ΔG O (i), ΔB O (i) Multiply by G R G G G B It can adjust the brightness and color intensity of each component and correct the aspect ratio deviation of the image.

[0140] The steps of linear correction are as follows: Linear correction is based on offset correction and scaling correction, taking into account two factors: the gain factor of different color components and the amount of color offset. Specifically, the original color difference is multiplied by the scaling deviation (G). R G G G B Then, by adding a color offset (R) offset G offset B offset A linear transformation is performed on the original image. In the linear correction method, the corrected color component ΔR C (i), ΔG C (i), ΔB C (i) is represented as follows:

[0141]

[0142] Among them, (G) R G G G B ) is the gain coefficient of the three color components, (R) offset G offset B offset ) represents the offset of the three color components; the correction process first adjusts the color intensity and then corrects the color offset, thereby more effectively correcting color errors in the image.

[0143] Step 6 specifically includes: selecting background brightness L1, L2, ..., L J Using a light source, the microalgae samples were tested under different conditions of color card color (C), frosted plate roughness (S), light intensity (L), and microalgae density (d) according to steps 2 to 5, and the observed color component ΔR was obtained. O (i), ΔG O (i), ΔB O (i), and then corrected to obtain the color component ΔR C (i), ΔG C (i), ΔB C (i). The color component ΔR C (i), ΔG C (i), ΔB C (i) Substitute into formula (2) and calculate multiple times to obtain the microalgae density test set matrix D. Total D Total A multidimensional matrix (i.e., D) Total ∈Z i×K×T×M×N×I×J );

[0144] Compare D under different conditions: color (C) of different color charts, roughness (S) of the frosted board, and light intensity (L). Total (DTotal ∈Z i×K×T×M×N×I×J The microalgae density test set matrix D obtained by manual counting method M The differences were analyzed, and the average accuracy was calculated. Specifically, the conditions for color card color (C), frosted plate roughness (S), and light intensity (L) were changed one by one, and the microalgae density measurement matrix D was selected. Total The matrix D corresponds to a series of microalgae density values ​​d obtained under specific conditions (such as under a specific color) and the microalgae density test set matrix D obtained by manual counting method. M The accuracy of a specific microalgae density (d) condition is calculated by comparing all the d values ​​and using the following formula.

[0145] In this embodiment, light sources with background brightness L1, L2, and L3 were selected. Following steps 2 to 5, two types of microalgae samples were tested under conditions of 5×5 color chart colors (C), 3 types of frosted plate roughness (S), 3 types of light intensity (L), and 6 types of microalgae density (d, 3 bottles per group), resulting in the microalgae density test set matrix D. Total D Total A multidimensional matrix (i.e., D) Total ∈Z 3×2×5×5×3×3×6 ).

[0146] Compare D under different conditions: color (C) of different color charts, roughness (S) of the frosted board, and light intensity (L). Total (D Total ∈Z 3×2×5×5×3×3×6 The microalgae density test set matrix D obtained by manual counting method M The differences were analyzed, and the average accuracy was calculated. Specifically, the conditions for color chart color (C), frosted plate roughness (S), and light intensity (L) were changed one by one, and the microalgae density measurement matrix D was selected. Total The matrix D corresponds to a series of microalgae density values ​​d obtained under specific conditions (such as under a specific color) and the microalgae density test set matrix D obtained by manual counting method. M By comparing all the d values, the accuracy under a specific microalgae density (d) condition is calculated using the following formula.

[0147]

[0148] That is, at a specific microalgae density (d), the accuracy is the absolute value of the difference between the microalgae density obtained by the manual counting method and the microalgae density obtained by this method, divided by the microalgae density obtained by the manual counting method; the accuracy is higher than 0 and lower than 1, and a value close to 0 indicates a large error, while a value close to 1 indicates a small error.

[0149] The above method was used to analyze the microalgae density test set matrix D obtained by the manual counting method. MThe parameters in the calculation are calculated one by one. Further, the average accuracy can be calculated using one of the following methods: (1) fix the parameters of roughness (S), light intensity (L), and microalgae density (d) of the frosted board, and calculate the average accuracy under different color card color (C) conditions; (2) fix the parameters of color card color (C), frosted board roughness (S), and microalgae density (d), and calculate the average accuracy under different light intensity (L) conditions; (3) fix the parameters of light intensity (L), color card color (C), and microalgae density (d), and calculate the average accuracy under different frosted board roughness (S) conditions; (4) fix the parameters of light intensity (L), color card color (C), and frosted board roughness (S), and calculate the average accuracy under different microalgae density (d) conditions.

[0150] Analyze the calculation results. Observe the D in the microalgae density average matrix. A The range of all values ​​is determined by the microalgae error matrix D. E The standard deviation was calculated to analyze the reliability of the microalgae density test results. For the low average accuracy of the microalgae density (d) measurement, the experimental protocol and conditions were adjusted to reduce systematic errors. The tests and calculations were repeated, and a closed-loop analysis and improvement of the experimental method were conducted.

[0151] Figures 4 to 9 The brightness of the test background light source was uniformly 2.68 milliwatts, the background roughness was uniformly zero, and the test background color was purple, gradually deepening. Figure 4 The relationship between microalgae density and R-channel color values ​​obtained under the test conditions of selecting a purple background and green algae is shown in the embodiments of this application. Figure 5 The relationship between microalgae density and G-channel color values ​​obtained under the test conditions of purple background and green algae provided in the embodiments of this application is shown. Figure 6 The relationship between microalgae density and B-channel color values ​​obtained under the test conditions of purple background and green algae provided in the embodiments of this application is shown. Figure 4 and Figure 5 Similar data trends were observed: as the background color depth increased, the previously approximately linear relationship between the R and G channel color values ​​and microalgae density became non-linear, exhibiting an overall decreasing trend. Experimental results indicate that the background color depth significantly impacted the color channel value measurements, indirectly affecting the derivation of microalgae density. Figure 6 The color value of the B channel differs from that of the R and G channels under different microalgae densities. When the microalgae density is high, the color value of the B channel drops rapidly to zero. Therefore, it is impossible to establish a relationship between the color value of the B channel and the microalgae density through fitting methods. In other words, the color value of the B channel cannot be used as a parameter to measure the change in microalgae density on its own.

[0152] Figure 7 The relationship between microalgae density and R-channel color values ​​obtained under test conditions of green background and brown algae provided in the embodiments of this application. Figure 8 The relationship between microalgae density and G-channel color values ​​obtained under the test conditions of green background and brown algae provided in the embodiments of this application is shown. Figure 9 This application provides an embodiment showing the relationship between microalgae density and B-channel color values ​​obtained under test conditions of a green background and brown algae. The test background color is selected as green, gradually deepening in color. Figures 4 to 6 The difference is, Figures 7 to 9 The data linearity is more pronounced, and the microalgae density corresponding to the B channel color value reaching zero is greater. This means that when using brown algae and a green background, the B channel color value is less likely to reach zero. Figure 7 and Figure 8 Most of the data show a good linear relationship between the R and G channel color values ​​and microalgae density, which can be used to deduce the magnitude of microalgae density under different test conditions.

[0153] Figure 10 The relationship between microalgae density and R-channel color values ​​under different brightness levels was obtained by selecting a white background and brown algae as test conditions in the embodiments of this application. Figure 11 The relationship between microalgae density and G-channel color values ​​under different brightness levels was obtained by selecting a white background and brown algae as test conditions in the embodiments of this application. Figure 12 The embodiments of this application provide the relationship between microalgae density and B-channel color values ​​under different brightness levels, obtained using a white background and brown algae as test conditions. Figure 10 and Figure 11 Under different brightness conditions, a good linear relationship was observed between the R and G channel color values ​​and microalgae density. At zero microalgae density, the R and G channel color values ​​slightly increased, deviating somewhat from the linear pattern; therefore, this value point can be removed during the fitting process. The B channel color value exhibited a non-linear relationship with microalgae density, and did not show a trend towards zero as microalgae density increased; therefore, the microalgae density can be derived inversely using the same fitting method.

[0154] Figure 13 The method for selecting offset correction provided in this application and the relationship between microalgae density and G-channel color values ​​obtained under the test condition of brown algae are described. Figure 14 The selection ratio correction method provided in the embodiments of this application and the relationship between microalgae density and G channel color values ​​obtained under the test condition of brown algae. Figure 15 This describes the relationship between the microalgae density and G-channel color values ​​obtained under the test conditions of selecting a linear correction method and brown algae as the test conditions provided in the embodiments of this application. Figures 13 to 15Scatter plots were created to depict the distribution of G channel color values ​​under test conditions of different gray background depths and six microalgae densities. Denser scatter plots indicate that the corrected G channel color values ​​are more convergent under different colored backgrounds, and closer to the performance against a pure white background. More dispersed scatter plots indicate that the corrected G channel color values ​​are less convergent under different colored backgrounds, and further away from the performance against a pure white background. Comparison revealed that… Figure 13 The G channel color values ​​obtained by the offset correction algorithm are the most convergent. That is, the G channel color values ​​of different shades of gray background can be adjusted to the same area by the offset correction method, which further facilitates the analysis of microalgae density.

[0155] Figure 16 The density measurement accuracy was obtained under the selected linear correction method and green algae as test conditions provided in the embodiments of this application. It can be seen that the average accuracy is approximately 0.94, and the accuracy under different microalgae density conditions is higher than 0.88, with the highest accuracy reaching 0.97. Furthermore, the error bars in the figure indicate that under multiple sampling tests, the lowest accuracy error is approximately 0.01, and the highest error is less than 0.04. The above data demonstrate that this method provides high accuracy and maintains high reliability under different test conditions.

[0156] In addition, the following important aspects also serve as supporting evidence of the novelty of this invention:

[0157] The expected benefits and commercial value of this invention after conversion are as follows:

[0158] (1) At present, the cultivation of functional microalgae has occupied a certain market share nationwide. At the same time, the cultivation and monitoring of microalgae is developing towards intelligent suspension monitoring and evaluation. The microalgae density method based on image recognition proposed in this invention can provide convenient technical support for the evaluation process.

[0159] (2) This invention achieves rapid detection of microalgae density through color recognition and mathematical modeling, which can improve measurement efficiency and reduce labor costs in laboratories and industrial production compared with traditional manual counting methods.

[0160] (3) Microalgae density is a key indicator for monitoring eutrophication in water bodies. This invention can be integrated into water quality monitoring equipment to achieve online detection of algae density in natural water bodies such as lakes and reservoirs. Compared with traditional sampling and testing methods, on-site real-time measurement can shorten the data feedback cycle and provide timely data support for early warning of cyanobacterial blooms.

[0161] (4) This invention uses an LED light source and a color recognizer, resulting in low hardware costs and standardized operation procedures, requiring no professional technicians. The finished measuring equipment can be sold to the scientific research instrument market of universities, research institutes, and small and medium-sized biotechnology enterprises.

[0162] (5) The color recognition-mathematical modeling technology principle of the present invention can be extended to other suspension density detection fields, such as bacterial culture medium, yeast cell suspension, etc.

[0163] (6) Microalgae bioenergy belongs to the encouraged industry under the national "dual carbon" target. The technology of this invention can help optimize the carbon fixation efficiency of microalgae and is expected to receive policy support such as government science and technology innovation funds and green industry subsidies.

[0164] This invention fills a technological gap in the industry both domestically and internationally:

[0165] (1) In the existing technology, most methods for measuring microalgae density only consider a single factor (such as light or background color) and lack a systematic study on the combined effects of multiple factors. This invention comprehensively considers the effects of multiple factors such as background color, light intensity, and roughness of the frosted plate on microalgae imaging, and proposes a multi-factor comprehensive analysis method that can measure microalgae density more comprehensively and accurately.

[0166] (2) Existing technologies typically use image color deviation to directly fit a mathematical model of microalgae density. This invention proposes a method for fitting the mathematical relationship between color deviation and microalgae solution density. By calculating the deviations of the color values ​​of each component (red, green, and blue) from the zero microalgae density sample, and using a polynomial fitting function to establish the relationship between the color vector and microalgae density, a quantitative conversion from image color information to microalgae density is achieved, improving the accuracy and reliability of the measurement.

[0167] (3) In the existing technology, there is a lack of a method for systematically correcting the color shift of the acquired image, resulting in insufficient accuracy and stability of the image color information. This invention introduces three color optimization algorithms: offset correction, proportional correction, and linear correction. These algorithms can effectively correct image color errors caused by factors such as background color shift and uneven illumination, thereby improving the accuracy and reliability of microalgae image color measurement and providing higher quality data for subsequent density analysis.

[0168] (4) In the existing technology, there is a lack of systematic management and analysis methods for microalgae density test set data, making it difficult to comprehensively evaluate the measurement results under different experimental conditions. This invention uses a multidimensional matrix to represent and process microalgae density test set data, incorporating multiple factors such as color card color, frosted plate roughness, light intensity, and microalgae density into the matrix system. This enables efficient management and analysis of data under complex experimental conditions and provides a quantitative basis for optimizing experimental conditions.

[0169] (5) In the prior art, most microalgae density measurement methods require destructive treatment of microalgae samples, which cannot achieve non-invasive real-time monitoring. This invention proposes a non-invasive microalgae density measurement method. Through image analysis and color processing technology, it can achieve rapid and accurate density measurement without damaging the microalgae sample. It is suitable for real-time monitoring of density changes during microalgae cultivation and provides strong support for the optimization of microalgae cultivation.

[0170] Does the technical solution of this invention solve the current technical problem?

[0171] (1) The technical solution of the present invention solves the problems of inefficiency and inaccuracy of traditional manual counting methods. Traditional manual counting methods are time-consuming, labor-intensive, inefficient, and easily affected by human factors, resulting in poor accuracy and repeatability of measurement results.

[0172] (2) The technical solution of this invention solves the problems of inaccurate measurement under the influence of a single factor and the inability to achieve cross-scene measurement. Existing microalgae density measurement technologies based on image analysis often only consider a single factor (such as illumination or background color), lacking a systematic study of the comprehensive influence of multiple factors, resulting in unstable and inaccurate measurement results. This invention comprehensively considers the influence of multiple factors such as background color, light intensity, and frosted plate roughness on microalgae imaging, and proposes a multi-factor comprehensive analysis method, which can measure microalgae density more comprehensively and accurately.

[0173] (3) The technical solution of this invention solves the measurement error problem caused by image color deviation. In the prior art, there is a lack of a method for systematically correcting the color shift of the acquired image, resulting in insufficient accuracy and stability of image color information, which in turn affects the measurement accuracy of microalgae density. This invention introduces three color optimization algorithms: offset correction, proportional correction, and linear correction, which can effectively correct image color errors caused by factors such as background color shift and uneven illumination, thereby improving the accuracy and reliability of microalgae image color measurement.

[0174] Does the technical solution of this invention overcome technical bias? In the field of microalgae density measurement, the traditional view holds that comprehensively considering the influence of multiple factors (such as background color, light intensity, and frosted plate roughness) on microalgae imaging would make the measurement process overly complex, making effective data processing and analysis difficult. Therefore, a simplified model based on a single factor is preferred. This invention uses a multidimensional matrix to represent and process microalgae density test set data, incorporating multiple factors such as color card color, frosted plate roughness, light intensity, and microalgae density into the matrix system, achieving efficient data management and analysis under complex experimental conditions. This method not only overcomes the complexity of multi-factor comprehensive analysis but also improves the accuracy and reliability of the measurement, breaking the traditional bias that multi-factor comprehensive analysis is infeasible.

[0175] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.

Claims

1. A method for measuring microalgae density based on image color correction, characterized in that, The method includes the following steps: Step 1: Prepare microalgae samples of different species and density gradients, and test the density of the microalgae samples using both traditional manual counting and image color recognition methods. Step 2: Process the discrete data of R, G, and B values ​​of the images obtained under different microalgae densities. Calculate the deviation of the color values ​​of each red, green, and blue component from the zero microalgae sample, and use a polynomial fitting function to establish the relationship between the color vector and the microalgae density, thereby obtaining the mathematical fitting formula between the color vector and the microalgae density. Step 3: Under background conditions of different colors, color gradients, roughness, and brightness, acquire microalgae images and calculate the color deviation of the images; Step 4: Introduce three color correction algorithms—offset correction, proportional correction, and linear correction—to the color deviation of the image calculated in Step 3. Correct the color deviation of the acquired image and substitute the corrected color components into the mathematical fitting formula in Step 2 to recalculate the color difference of the microalgae image. Step 5: Using the image color difference obtained in Step 4, deduce the value of microalgae density in reverse and analyze the image color difference-microalgae density relationship curve; Step 6: Calculate the accuracy and stability of the microalgae density measurement in Step 5 under different test conditions, adjust the experimental scheme and conditions to reduce systematic errors, and conduct closed-loop analysis and improvement of the experimental test method.

2. The microalgae density measurement method based on image color correction according to claim 1, characterized in that, Step 1 specifically includes: Step 11: Select F types of microalgae for density measurement, and prepare T types of microalgae samples with density gradients, placing them in microalgae solution bottles; the sampling method for microalgae samples is as follows: prepare i samples of the same algae species and the same density as one group (i = 1, 2, 3, ...); microalgae samples of different densities have visual color gradations; change the algae species and use the same method to prepare samples for the F types of microalgae; use the traditional manual counting method to calibrate the density of all microalgae samples, and obtain the density matrix D. F×T This indicates that the elements in the matrix include d. 1,1 d 1,2 、…、d F,T A dataset of artificially counted microalgae densities; mathematically, D∈Z F×T The density D of microalgae samples obtained by manual counting is an F×T matrix, where Z is the matrix symbol. The average density and density error are calculated for i microalgae samples of the same species and density. By changing the algae species and density, the average density and error of the F×T groups of microalgae samples under different species and density conditions are finally obtained. In the above data, the average microalgae density is represented by a matrix D. A D A ∈Z F×T The microalgae error is represented by a matrix D. E D E ∈Z F×T Save data; Step 12: Select an LED flat panel lamp (2) with any luminous color, color temperature, and uniform luminous intensity, and fix its luminous brightness; fix the position of the guide rail (7) on the experimental table, and fix the LED flat panel lamp (2) below the guide rail (7) to provide bottom illumination for the microalgae solution bottle (1); fix the back plate (3), color card (4), and transparent frosted plate (5) with the fixer (6), and further fix them at a specific position on the guide rail (7) so that the light emitted by the LED flat panel lamp (2) can cover the periphery of the back plate (3); Step 13: Place the microalgae solution bottle (1) on the LED flat panel light (2) so that the light emitted by the LED flat panel light (2) passes through the bottom of the microalgae solution bottle (1) and fix the microalgae solution bottle (1) in the middle position in front of the back plate (3). Step 14: Use the bracket (9) to place and fix the color recognizer (8) in front of the microalgae solution bottle (1), ensuring that the color recognition area of ​​the color recognizer (8) is located in the center of the microalgae solution bottle (1), and ensuring that the color recognition area is aligned with the area containing the microalgae solution. Step 15: Connect the color recognizer (8) to the image processing device (10) and connect the LED flat panel light (2) to the power supply (11); under different background colors and LED flat panel light (2) brightness parameters, change different microalgae solution bottles (1) to collect color information of different microalgae samples, save and record them in the image processing device (10).

3. The microalgae density measurement method based on image color correction according to claim 2, characterized in that, Step 2 specifically includes: The color recognizer (8) analyzes the image colors of different microalgae samples, obtains the red, green, and blue (R, G, B) values ​​corresponding to different microalgae images, and saves them to the image processing device (10); it processes the discrete data of R, G, and B values ​​of the images obtained under different microalgae densities; among them, the deviation ΔR between the color value of the red component (R) and the zero microalgae density sample (R0, G0, B0) is ΔR = R0 - R, the deviation ΔG between the color value of the green component (G) and the zero microalgae density sample (R0, G0, B0) is ΔG = G0 - G, and the deviation ΔB between the color value of the blue component (B) and the zero microalgae density sample (R0, G0, B0) is ΔB = B0 - B; The following formula is used to fit the mathematical relationship between the color vector and the density of the microalgae solution: d=f(ΔR,ΔG,ΔB)=∑ i+j+k≤n c ijk ΔR i ΔG j ΔB k (1); Where f(ΔR,ΔG,ΔB) is the fitted function, c refers to the weighting coefficients for different measurement times, i, j, k represent the subscripts of c and the powers of R, G, B, and n is the maximum order of the polynomial; compared with the Euclidean distance color difference calculation method in color space, this formula retains more of the directional information of the original vector and has more flexible nonlinear modeling capabilities, which can achieve higher color difference-microalgae density fitting accuracy; the expanded form of formula (1) is as follows: d=f(ΔR,ΔG,ΔB)=c 200 ΔR 2 +c 110 ΔRΔG+c 101 ΔRΔB+c 020 ΔG 2 +c 011 ΔGΔB+c 002 ΔB 2 (2)。 4. The microalgae density measurement method based on image color correction according to claim 3, characterized in that, Step 3 specifically includes: Prepare color charts of M different color series, including red, yellow, green, blue, and purple, labeled C1, C2, ..., C60. M Each color series has N color gradients; therefore, the color chart for the Mth color can be labeled as C. M1 C M2 ..., C MN The different color gradients and color swatches of the entire series can be represented as a two-dimensional matrix: C∈Z M×N , specifically, Prepare roughness values ​​S1, S2, ..., S I For I different roughness frosted plates, their matrix representation is: S∈Z I , specifically, The frosted plate (5) is placed and fixed in front of the color chart (4) to change the roughness of the microalgae imaging background; then the entire color chart with different color series and different roughness can be represented as the following matrix: Specifically, in, The symbols represent the interaction between different color series and roughness color cards, indicating the process by which these cards work together to affect the background color of a microalgae sample. Furthermore, the interaction is illustrated by different background brightness levels L1, L2, ..., L... J Under the condition that L∈R J Microalgae samples of different densities, D1, D2, ..., D, were selected. K, That is, D∈Z K Color cards of different color series and roughness were used as backgrounds to identify the color of microalgae solutions one by one. Through experimental testing, the color deviation obtained from the measured microalgae images can be generally represented as Δ(R). O G O B O The expression for ) is as follows: Δ(R O ,G O ,B O )=g(C M,N ,S I ,L J ,d)+e (5); Formula (5) shows that the actual observed color deviation Δ(R) O G O B O The effect is influenced by the color of the color chart (C), the roughness of the frosted plate (S), the light intensity (L), the microalgae density (d), and the systematic error (ε); the functional expression of g() is: Specifically, Therefore, Δ(R) O G O B O The final result can be expressed as matrix Z. 3 means, specifically, 5. The microalgae density measurement method based on image color correction according to claim 4, characterized in that, Step 4 specifically includes: Three color optimization algorithms—offset correction, scaling correction, and linear correction—are introduced to correct color shifts in the acquired images. Specifically, the offset correction steps are as follows: Using a 0-density microalgae sample (D0), a background brightness of L1, and a color chart of pure white (C... 00 Under the condition that the background roughness is 0 (S0), the measured image color is compared with that of an ideal pure white card (C). 00 The color difference between the two is used to obtain the color offset (R). offset G offset B offset That is, the offset (R) offset G offset B offset ) indicates that, under conditions without color components, each component is relative to the ideal pure white (C). 00 The color offset value of the microalgae image is used to correct the error caused by the background color offset; the specific calculation is as follows: Where i represents the i-th sample group; the color differences of the actually observed red, green, and blue components are represented by ΔR. O (i), ΔG O (i), ΔB O (i) The corrected color differences of the red, green, and blue components are expressed as ΔR. C (i), ΔG C (i), ΔB C (i); The steps for proportional correction are as follows: Under standard white conditions, measure the proportional deviation of each color component relative to the ideal value to obtain the gain coefficient (G). R G G G B These coefficients are used to scale images with color differences, thereby adjusting color intensity; in the scaling correction method, ΔR C (i), ΔG C (i), ΔB C (i) is represented as follows: Among them, G R G G G B It is based on the ideal pure white (C 00 The gain coefficients of each component (R, G, B) are calculated using the color ratio of the pure white card used in the actual test; the color difference ΔR of the red, green, and blue components is then used as the actual observed color difference. O (i), ΔG O (i), ΔB O (i) Multiply by G R G G G B It can adjust the brightness and color intensity of each component to correct image scaling deviations; The steps of linear correction are as follows: Linear correction is based on offset correction and scaling correction, taking into account two factors: the gain factor of different color components and the color offset; specifically, the original color difference is multiplied by the scaling deviation (G). R G G G B Then, by adding a color offset (R) offset G offset B offset A linear transformation is performed on the original image; in the linear correction method, the corrected color component ΔR C (i), ΔG C (i), ΔB C (i) is represented as follows: Among them, (G) R G G G B ) is the gain coefficient of the three color components, (R) offset G offset B offset ) represents the offset of the three color components; the correction process first adjusts the color intensity and then corrects the color offset, thereby more effectively correcting color errors in the image.

6. The microalgae density measurement method based on image color correction according to claim 5, characterized in that, Step 6 specifically includes: selecting background brightness L1, L2, ..., L J Using a light source, the microalgae samples were tested under different conditions of color card color (C), frosted plate roughness (S), light intensity (L), and microalgae density (d) according to steps 2 to 5, and the observed color component ΔR was obtained. O (i), ΔG O (i), ΔB O (i), and then corrected to obtain the color component ΔR C (i), ΔG C (i), ΔB C (i); change the color component ΔR C (i), ΔG C (i), ΔB C (i) Substitute into formula (2) and calculate multiple times to obtain the microalgae density test set matrix D. Total D Total It is a multidimensional matrix, i.e., D Total ∈Z i×K×T×M×N×I×J ; Compare D under different conditions: color (C) of different color charts, roughness (S) of the frosted board, and light intensity (L). Total ∈Z i ×K×T×M×N×I×J The microalgae density test set matrix D obtained by manual counting method M The differences were analyzed, and the average accuracy was calculated. Specifically, the conditions for color card color (C), frosted plate roughness (S), and light intensity (L) were changed one by one, and the microalgae density measurement matrix D was selected. Total The matrix D corresponds to a series of microalgae density values ​​d obtained under specific conditions and the microalgae density test set matrix D obtained by manual counting method. M The accuracy of a specific microalgae density (d) condition is calculated by comparing all the d values ​​and using the following formula. At a specific microalgae density (d), the accuracy is the absolute value of the difference between the microalgae density obtained by the manual counting method and the microalgae density obtained by this method, divided by the microalgae density obtained by the manual counting method. This accuracy is higher than 0 and lower than 1. If it is close to 0, it indicates a large error, and if it is close to 1, it indicates a small error. The above method was used to analyze the microalgae density test set matrix D obtained by the manual counting method. M The parameters are calculated one by one; furthermore, the average accuracy can be calculated using one of the following methods: With the parameters of roughness (S), light intensity (L), and microalgae density (d) of the fixed frosted plate, the average accuracy was calculated under different color card (C) conditions. With fixed parameters of color card color (C), frosted board roughness (S), and microalgae density (d), the average accuracy was calculated under different light intensities (L). (3) With fixed parameters of light intensity (L), color card color (C), and microalgae density (d), calculate the average accuracy under different frosted board roughness (S) conditions; (4) With fixed parameters of light intensity (L), color card color (C), and frosted board roughness (S), calculate the average accuracy under different microalgae density (d) conditions. Analyze the calculation results and observe the D in the microalgae density average matrix. A The range of all values ​​is determined by the microalgae error matrix D. E The standard deviation was calculated to analyze the reliability of the microalgae density test results. For the microalgae density (d) measurement with low average accuracy, the experimental scheme and experimental conditions were adjusted to reduce systematic errors. The test and calculation were repeated to conduct closed-loop analysis and improve the experimental test method.