Pollen automatic sampling anti-stacking control method

By adjusting the sampling dwell time of the slide and the number of sampling areas, combined with the optimization of the PID controller, the problem of pollen stacking was solved and the accuracy and stability of pollen monitoring were improved.

CN118362483BActive Publication Date: 2024-09-20RES CENT FOR ECO ENVIRONMENTAL SCI THE CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410799193.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-09-20
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

In existing pollen monitoring devices, in high-concentration pollen environments, pollen in the sampling area is easily stacked, resulting in the inability to count the number of pollen under the surface during image processing, affecting the accurate identification of pollen quantity and type.

Method used

By adjusting the sampling dwell time of the slide, and using the PID controller to adjust the sampling ratio and number of areas based on grayscale image information and stacking feedback values, pollen stacking or over-dispersion can be avoided.

Benefits of technology

It improves the accuracy of pollen count statistics and type identification, ensuring the stability and accuracy of sampling results in different environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118362483B
    Figure CN118362483B
Patent Text Reader

Abstract

The invention discloses a pollen automatic sampling anti-stacking control method, which belongs to the field of pollen monitoring. The method comprises the following steps: obtaining a plurality of grayscale images of each sampling area of ​​a current glass slide; counting the count values ​​of pixels in a black area of ​​the grayscale image; judging whether all Prs of the current glass slide are greater than 1 or whether the number of sampling areas is less than a sampling number threshold value, and if so, selecting the maximum count value of the current glass slide as a stacking degree feedback value; otherwise, updating the output of a PID controller according to the count value of each sampling area, and then updating a sampling ratio Pr; when Pr≥1, the sampling residence time of a next glass slide remains unchanged, and when Pr<1, the sampling time of the sampling area corresponding to the next glass slide=Ts×Pr; updating the output out2 of the PID controller according to the stacking degree feedback value, and updating the number of sampling areas St; and updating the sampling residence time of the sampling area of ​​the next glass slide according to St and the sampling time of the sampling area being equal to Ts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of pollen monitoring, and in particular to a pollen automatic sampling and anti-stacking control method. Background Art

[0002] Pollen pollution is an important aspect of air pollution. Pollen pollution can cause pollen allergic reactions, which is the most common and important of allergic reactions and can induce seasonal allergic rhinitis, asthma and dermatitis. The severity of symptoms in patients with pollen allergies is correlated with the type and concentration of pollen. Therefore, conducting research on pollen pollution and analyzing the types, concentrations, seasonal changes and spatial distribution of pollen in the atmosphere are of great significance for the clinical diagnosis and treatment of allergic diseases. Pollen monitoring and providing pollen reports to the public can deepen the public's understanding of allergic diseases and remind patients to take preventive measures.

[0003] When performing pollen monitoring, the pollen monitoring device in the prior art sucks air into a closed space, and the air hits a glass slide in the space, causing the pollen to adhere to the glass slide. The glass slide is then photographed, and the photograph is combined with image processing technology to obtain the number of pollen on the glass slide and / or the type of pollen identified, thereby obtaining the pollen concentration and type in the atmosphere, and reminding people who are allergic to pollen to take preventive measures.

[0004] When monitoring pollen, existing monitoring devices generally use one glass slide a day and divide the glass slide into multiple sampling areas, each area corresponding to a time period, and the glass slide is moved to ensure that air hits different sampling areas of the glass slide in different time periods to obtain pollen concentrations at different times of the day; when monitoring in this way, if the glass slide size is large, the collection time is short or the pollen concentration is relatively small, the collected pollen will not overlap on the glass slide, but when the pollen concentration in the air is relatively high in spring, the pollen will overlap in the sampling area, which makes it impossible to count the number of pollen below the surface during image processing, resulting in low accuracy in pollen number statistics; pollen type identification is performed through contour identification, and large overlaps will also affect the accurate identification of pollen contours and pollen types. Summary of the invention

[0005] With respect to the above steps in the prior art, the pollen automatic sampling and anti-stacking control method provided by the present invention can solve the problem of pollen stacking on a glass slide by adjusting the sampling residence time of the next glass slide.

[0006] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:

[0007] Provided is a pollen automatic sampling and anti-stacking control method, which comprises the steps of:

[0008] S1, obtaining multiple image information of each sampling area of ​​the current slide, and preprocessing the image to obtain a grayscale image;

[0009] S2, calculating the gray value of each pixel in the gray image, and determining the count value of the pixel in the black area of ​​each sampling area according to the gray value;

[0010] S3, judging whether all sampling ratios of the current slide are greater than 1 or whether the number of sampling areas of the current slide is less than the total number of initial sampling areas, if so, proceeding to step S5, otherwise, proceeding to step S8;

[0011] S4, according to the count value of each sampling area, update the output out1 of the PID controller, and update the sampling ratio Pr = sampling ratio Pr + out1;

[0012] S5. When Pr≥1, the sampling time of the sampling area corresponding to the next slide is equal to the sampling stay time of the current slide. When Pr<1, the sampling time of the sampling area corresponding to the next slide = Ts×Pr;

[0013] S6, selecting the maximum value among the count values ​​of all sampling areas of the current slide as the stacking degree feedback value;

[0014] S7. According to the stacking degree feedback value, update the output out2 of the PID controller, and update the number of sampling areas St=St+int(out2), where int is a rounding function;

[0015] S8. According to the total sampling time Cy of a single glass slide and the number of sampling areas St, update the sampling dwell time Ts=Cy / St of the sampling area of ​​the next glass slide, and the sampling time of each sampling area is equal to Ts.

[0016] Furthermore, step S2 further comprises:

[0017] S21. Calculate the gray value Gray of each pixel in the gray image:

[0018] Gray=0.299*R+0.587*G+0.114*B

[0019] Where R, G, and B are the values ​​of the red, green, and blue channels of each pixel in the grayscale image, respectively.

[0020] S22, setting the pixel points whose grayscale value is less than the grayscale threshold to zero, and setting the pixel points whose grayscale value is greater than or equal to the grayscale threshold to 255;

[0021] S23, counting the total number of zero pixels in the same grayscale image, and calculating the average value of the total number of pixels of all grayscale images in the same sampling area as the count value.

[0022] The beneficial effect of the above technical solution is: this solution can accurately calculate the grayscale value of each pixel through the constructed grayscale value expression, and then on this basis combined with the set grayscale threshold, it can accurately count the number of pixels in the black area, providing a guarantee for the subsequent accurate judgment of the stacking situation.

[0023] Further, the method for updating the output out1 of the PID controller includes:

[0024] S41. Calculate the error value Errvalue, the error accumulation value Intvalue and the error change rate Dervalue in the PID controller according to the count value of the sampling area:

[0025] Errvalue=Setvalue–Curvalue

[0026] Intvalue=Intvalue0+Errvalue

[0027] Dervalue=Errvalue–Preverror

[0028] Among them, Setvalue is the preset threshold; Curvalue is the count value; Preverror is the error correction value; Intvalue0 is the error accumulation value of the sampling area corresponding to the previous slide;

[0029] S42, according to the error value and the preset threshold, determine the proportional coefficient Kp, integral coefficient Ki and differential coefficient Kd in the PID controller:

[0030] When abs(Errvalue-Setvalue) <Th1:Kp=0,Ki=0,Kd=0;

[0031] When Th1 <abs(Errvalue-Setvalue)<Th2:Kp=Kp0,Ki=10*Ki0,Kd=Kd0;

[0032] When Th2 <abs(Errvalue-Setvalue):Kp=10*Kp0,Ki=Ki0,Kd=Kd0;

[0033] Where abs(.) is the absolute value function; Th1 and Th2 are the upper and lower thresholds, respectively; Kp0, Ki0, and Kd0 are the proportional coefficient, integral coefficient, and differential coefficient of the sampling area corresponding to the previous slide, respectively;

[0034] S43. Update the output out1 of the PID controller according to Errvalue, Intvalue, Dervalue, Kp, Ki and Kd:

[0035] Out1=Kp*Errvalue+Ki*Intvalue+Kd*Dervalue.

[0036] The beneficial effect of the above technical solution is: this solution can obtain an optimal correction value through the adjustment of proportion, integration and differentiation to reset the sampling ratio Pr to achieve the effect of preventing stacking.

[0037] Furthermore, between step S42 and step S43, the following steps are also included:

[0038] A1, determine whether at least one slide has been collected before the current slide is collected in the current month, if so, proceed to step A2, otherwise directly proceed to step S43;

[0039] A2. Increase the differential coefficient Kd obtained in step S42 by a preset multiple, and then proceed to step S43.

[0040] The beneficial effect of the above technical solution is: by adjusting the differential coefficient, the purpose is to focus on the future prediction ability of the system, so that the calculated out1 can more accurately evaluate the stacking situation of pollen in the current environment.

[0041] Furthermore, the method for obtaining the error correction value includes:

[0042] B1, determine whether the error values ​​of at least two slides have been recorded before the current slide is collected in the current month; if so, proceed to step B2, otherwise proceed to step B4;

[0043] B2. Calculate the average of the error values ​​of all slides in the current month corresponding to the same sampling area of ​​the current slide;

[0044] B3, obtaining the error value of the sampling area corresponding to the previous slide of the current sampling area of ​​the current slide, and calculating the average of the error value and the average value as the final error correction value;

[0045] B4. Use the error value of the previous slide corresponding to the same sampling area of ​​the current slide as the error correction value.

[0046] The beneficial effect of the above technical solution is that the actual effect of sampling is correlated with the weather. This solution calculates the average error value of the same month and uses this data to eliminate the influence of weather.

[0047] Further, the method for updating the output out2 of the PID controller includes:

[0048] S71. Calculate the stacking error value Errvalue2, the stacking error cumulative value Intvalue2 and the stacking error change rate Dervalue2 in the PID controller according to the stacking degree feedback value of the current slide:

[0049] Errvalue2=Setvalue2–Curvalue2

[0050] Intvalue2=Intvalue20+Errvalue2

[0051] Dervalue2=Errvalue2–Intvalue20

[0052] Among them, Curvalue2 is the stacking degree feedback value; Setvalue2 is the preset parameter value; Intvalue20 is the stacking error value corresponding to the last update of the sampling dwell time;

[0053] S72, update the stack proportional coefficient Kp2, the stack differential coefficient Ki2 and the stack integral coefficient Kd2:

[0054] When Curvalue2 <Thmin:Kp2=10*Kp2,Ki2=Ki2,Kd2=0;

[0055] When Thmin≤Curvalue2 <Thmax:Kp2=0,Ki2=Ki2,Kd2=0;

[0056] When Thmax≤Curvalue2: Kp2=10*Kp2, Ki2=Ki2, Kd2=0;

[0057] Among them, Kp20 and Ki20 are the stacking proportional coefficient and stacking differential coefficient corresponding to the last updated sampling residence time; Thmin and Thmax are the lower limit and upper limit of the stacking degree threshold respectively;

[0058] S73, calculate the output out2 of the PID controller:

[0059] Out2=Kp2*Errvalue2+Ki2*Intvalue2+Kd2*Dervalue2.

[0060] The beneficial effect of the above technical solution is: when the collected pollen is relatively scattered, this solution will reset the number of sampling areas St to control the total duration and sampling duration of a single sampling area to achieve the best sampling effect.

[0061] Furthermore, the total sampling time for a single glass slide is one day, and the initial value of the sampling residence time = 24h / N, where N is the total number of sampling areas at the initial moment; when conducting pollen sampling, the start time of pollen sampling in each sampling area is counted, and when the timing duration is equal to the corresponding sampling duration, sampling of the sampling area is stopped.

[0062] The beneficial effects of the present invention are as follows: the present solution determines the number of pixels in the black area of ​​the sampling area by the grayscale value of the pixels in the image of the sampling area, and then based on the conditions set in step S3, the sampling ratio of each sampling area is adjusted in combination with the output of the PID controller when the conditions are not met, so as to avoid the overlapping of pollen collected in the sampling area. When the conditions are met, the number of sampling areas is adjusted to avoid too many sampling areas, so that the pollen in the sampling area is too scattered; or too few sampling areas, so that no matter how the sampling ratio is adjusted, there is still overlapping of pollen.

[0063] This scheme analyzes the overlap and dispersion of pollen on the slide that has recently completed pollen collection, and adjusts the sampling residence time or the number of sampling areas in each sampling area to avoid pollen stacking or excessive dispersion when the next slide is used for pollen sampling, which affects the accurate counting of the pollen number, thereby ensuring the accuracy of subsequent pollen number statistics and pollen contour identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 Flow chart of the anti-stacking control method for automatic pollen sampling.

[0065] Figure 2 This is a schematic diagram of the sampling area division on the slide. DETAILED DESCRIPTION

[0066] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0067] When the anti-stacking control method of this scheme is used, it needs to cooperate with the mechanism of moving the slide. When moving the sample, this scheme divides the entire sampling area on the slide into 30 small sampling areas. The diagram of the division of the slide can be referred to Figure 2 .

[0068] The anti-stacking control method of this solution will establish a virtual coordinate system for the slide, and the coordinate information of each sampling area will be recorded when scanning and taking pictures. After the first sampling, the sampling result image will be obtained. According to the X-axis information of the image coordinates, the sampling area to which the image belongs can be determined. For example, the X-axis range between 46-50 is sampling area 1, and the X-axis range between 41-45 is sampling area 2. The calculation formula for the minimum X-axis range Xmin and the maximum X-axis range Xmax of any sampling area n is: Xmin=46-5*n; Xmax=50-5*n.

[0069] In this scheme, at the initial moment of sampling, the total sampling time for a single slide is one day, and the initial value of the sampling residence time = 24h / N, where N is the total number of initial sampling areas. When pollen sampling is performed, the start time of pollen sampling in each sampling area is counted, and when the timing time is equal to the corresponding sampling time, sampling of the sampling area is stopped.

[0070] After the first sampling and scanning, a picture of each sampling area can be obtained, and the anti-stacking control method of this scheme can be used to adjust the sampling step length of the next slide and the total number of sampling areas to avoid stacking or excessive dispersion of pollen in each sampling area.

[0071] refer to Figure 1 , Figure 1 A flow chart of the pollen automatic sampling anti-stacking control method is shown; Figure 1 As shown, the method S includes steps S1 to S8.

[0072] In step S1, multiple image information of each sampling area of ​​the current slide is obtained, and the image is preprocessed to obtain a grayscale image;

[0073] This solution preferably collects 5 pictures in each sampling area, specifically, each sampling area is divided into 5 equal parts, and one picture is collected in each part of each area.

[0074] In step S2, the grayscale value of each pixel in the grayscale image is calculated, and the count value of the pixel in the black area of ​​each sampling area is determined according to the grayscale value;

[0075] During implementation, the preferred step S2 of this solution further includes:

[0076] S21. Calculate the gray value Gray of each pixel in the gray image:

[0077] Gray=0.299*R+0.587*G+0.114*B

[0078] Among them, R, G, and B are the values ​​of the red, green, and blue channels of each pixel in the grayscale image;

[0079] S22, setting the pixel points whose grayscale value is less than the grayscale threshold to zero, and setting the pixel points whose grayscale value is greater than or equal to the grayscale threshold to 255;

[0080] S23, counting the total number of zero pixels in the same grayscale image, and calculating the average value of the total number of pixels of all grayscale images in the same sampling area as the count value.

[0081] In step S3, it is determined whether all sampling ratios of the current slide are greater than 1 or whether the number of sampling areas of the current slide is less than the total number of initial sampling areas. If so, it proceeds to step S6, otherwise, it proceeds to step S4;

[0082] In step S4, the output out1 of the PID controller is updated according to the count value of each sampling area, and the sampling ratio Pr is updated = sampling ratio Pr + out1;

[0083] In one embodiment of the present invention, the method for updating the output out1 of the PID controller includes:

[0084] S41. Calculate the error value Errvalue, the error accumulation value Intvalue and the error change rate Dervalue in the PID controller according to the count value of the sampling area:

[0085] Errvalue=Setvalue–Curvalue

[0086] Intvalue=Intvalue0+Errvalue

[0087] Dervalue=Errvalue–Preverror

[0088] Among them, Setvalue is the preset threshold; Curvalue is the count value; Preverror is the error correction value; Intvalue0 is the error accumulation value of the sampling area corresponding to the previous slide;

[0089] During implementation, the preferred method for obtaining the error correction value of this scheme includes:

[0090] B1, determine whether the error values ​​of at least two slides have been recorded before the current slide is collected in the current month; if so, proceed to step B2, otherwise proceed to step B4;

[0091] B2. Calculate the average of the error values ​​of all slides in the current month corresponding to the same sampling area of ​​the current slide;

[0092] B3, obtaining the error value of the sampling area corresponding to the previous slide of the current sampling area of ​​the current slide, and calculating the average of the error value and the average value as the final error correction value;

[0093] B4. Use the error value of the previous slide corresponding to the same sampling area of ​​the current slide as the error correction value.

[0094] S42, according to the error value and the preset threshold, determine the proportional coefficient Kp, integral coefficient Ki and differential coefficient Kd in the PID controller:

[0095] When abs(Errvalue-Setvalue) <Th1:Kp=0,Ki=0,Kd=0;

[0096] When Th1 <abs(Errvalue-Setvalue)<Th2:Kp=Kp0,Ki=10*Ki0,Kd=Kd0;

[0097] When Th2 <abs(Errvalue-Setvalue):Kp=10*Kp0,Ki=Ki0,Kd=Kd0;

[0098] Where abs(.) is the absolute value function; Th1 and Th2 are the upper and lower thresholds, respectively; Kp0, Ki0, and Kd0 are the proportional coefficient, integral coefficient, and differential coefficient of the sampling area corresponding to the previous slide, respectively;

[0099] S43. Update the output out1 of the PID controller according to Errvalue, Intvalue, Dervalue, Kp, Ki and Kd:

[0100] Out1=Kp*Errvalue+Ki*Intvalue+Kd*Dervalue.

[0101] In order to improve the prediction performance of the present solution for the future, the present solution preferably further includes between step S42 and step S43:

[0102] A1, determine whether at least one slide has been collected before the current slide is collected in the current month, if so, proceed to step A2, otherwise directly proceed to step S43;

[0103] A2. Increase the differential coefficient Kd obtained in step S42 by a preset multiple, and then proceed to step S43.

[0104] In step S5, when Pr≥1, the sampling time of the sampling area corresponding to the next slide is equal to the sampling dwell time of the current slide; when Pr<1, the sampling time of the sampling area corresponding to the next slide=Ts×Pr.

[0105] In step S6, the maximum value among the count values ​​of all sampling areas of the current slide is selected as the stacking degree feedback value;

[0106] In step S7, according to the stacking degree feedback value, the output out2 of the PID controller is updated, and the number of sampling areas St=St+int(out2) is updated, where int is a rounding function;

[0107] Methods for updating the output out2 of the PID controller include:

[0108] S71. Calculate the stacking error value Errvalue2, the stacking error cumulative value Intvalue2 and the stacking error change rate Dervalue2 in the PID controller according to the stacking degree feedback value of the current slide:

[0109] Errvalue2=Setvalue2–Curvalue2

[0110] Intvalue2=Intvalue20+Errvalue2

[0111] Dervalue2=Errvalue2–Intvalue20

[0112] Among them, Curvalue2 is the stacking degree feedback value; Setvalue2 is the preset parameter value; Intvalue20 is the stacking error value corresponding to the last update of the sampling dwell time;

[0113] S72, update the stack proportional coefficient Kp2, the stack differential coefficient Ki2 and the stack integral coefficient Kd2:

[0114] When Curvalue2 <Thmin:Kp2=10*Kp2,Ki2=Ki2,Kd2=0;

[0115] When Thmin≤Curvalue2 <Thmax:Kp2=0,Ki2=Ki2,Kd2=0;

[0116] When Thmax≤Curvalue2: Kp2=10*Kp2, Ki2=Ki2, Kd2=0;

[0117] Among them, Kp20 and Ki20 are the stacking proportional coefficient and stacking differential coefficient corresponding to the last updated sampling residence time; Thmin and Thmax are the lower limit and upper limit of the stacking degree threshold respectively;

[0118] S73, calculate the output out2 of the PID controller:

[0119] Out2=Kp2*Errvalue2+Ki2*Intvalue2+Kd2*Dervalue2.

[0120] In step S8, according to the total sampling time Cy of a single glass slide and the number of sampling areas St, the sampling dwell time Ts=Cy / St of the sampling area of ​​the next glass slide is updated, and the sampling time of each sampling area is equal to Ts.

[0121] After sampling of a glass slide is completed, this scheme executes steps S1 to S8 once. The whole method includes several steps S1 to S8. For example, the algorithm is terminated once after executing 30 times. After that, when the control method of this scheme is started, all parameters are initialized.

[0122] In summary, the sampling scheme of pollen by using the stacking control method can not only avoid the phenomenon of pollen stacking, but also avoid the situation where pollen is too dispersed.

Claims

1. A pollen automatic sampling anti-stacking control method, characterized in that: Includes steps: S1, obtaining multiple image information of each sampling area of ​​the current slide, and preprocessing the image to obtain a grayscale image; S2, calculating the gray value of each pixel in the gray image, and determining the count value of the pixel in the black area of ​​each sampling area according to the gray value; S3, judging whether all sampling ratios of the current slide are greater than 1 or whether the number of sampling areas of the current slide is less than the total number of initial sampling areas, if so, proceeding to step S6, otherwise, proceeding to step S4; S4. Update the output out1 of the PID controller according to the count value of each sampling area, and update the sampling ratio Pr = sampling ratio Pr + out1; S5. When Pr≥1, the sampling time of the next slide corresponding to the sampling area is equal to the sampling dwell time Ts of the current slide. When Pr<1, the sampling time of the next slide corresponding to the sampling area = Ts×Pr; S6, selecting the maximum value among the count values ​​of all sampling areas of the current slide as the stacking degree feedback value; S7. According to the stacking degree feedback value, update the output out2 of the PID controller, and update the number of sampling areas St=St+int(out2), where int is a rounding function; S8. According to the total sampling time Cy of a single glass slide and the number of sampling areas St, update the sampling dwell time Ts=Cy / St of the sampling area of ​​the next glass slide, and the sampling time of each sampling area is equal to Ts; The method of updating the output out1 of the PID controller includes: S41. Calculate the error value Errvalue, the error accumulation value Intvalue and the error change rate Dervalue in the PID controller according to the count value of the sampling area: Errvalue=Setvalue–Curvalue Intvalue=Intvalue0+Errvalue Dervalue=Errvalue–Preverror Among them, Setvalue is the preset threshold; Curvalue is the count value; Preverror is the error correction value; Intvalue0 is the error accumulation value of the sampling area corresponding to the previous slide; S42, according to the error value and the preset threshold, adjusting the proportional coefficient Kp, the integral coefficient Ki and the differential coefficient Kd in the PID controller: When abs(Errvalue-Setvalue) <Th1:Kp=0,Ki=0,Kd=0; When Th1 <abs(Errvalue-Setvalue)<Th2:Kp=Kp0,Ki=10*Ki0,Kd=Kd0; When Th2 <abs(Errvalue-Setvalue):Kp=10*Kp0,Ki=Ki0,Kd=Kd0; Where abs(.) is the absolute value function; Th1 and Th2 are the upper and lower thresholds, respectively; Kp0, Ki0, and Kd0 are the proportional coefficient, integral coefficient, and differential coefficient of the sampling area corresponding to the previous slide, respectively; S43. Update the output out1 of the PID controller according to Errvalue, Intvalue, Dervalue, Kp, Ki and Kd: Out1=Kp*Errvalue+Ki*Intvalue+Kd*Dervalue; Methods for updating the output out2 of the PID controller include: S71. Calculate the stacking error value Errvalue2, the stacking error cumulative value Intvalue2 and the stacking error change rate Dervalue2 in the PID controller according to the stacking degree feedback value of the current slide: Errvalue2=Setvalue2–Curvalue2 Intvalue2=Intvalue20+Errvalue2 Dervalue2=Errvalue2–Intvalue20 Among them, Curvalue2 is the stacking degree feedback value; Setvalue2 is the preset parameter value; Intvalue20 is the stacking error value corresponding to the last update of the sampling dwell time; S72, update the stack proportional coefficient Kp2, the stack differential coefficient Ki2 and the stack integral coefficient Kd2: When Curvalue2 <Thmin:Kp2=10*Kp2,Ki2=Ki2,Kd2=0; When Thmin≤Curvalue2 <Thmax:Kp2=0,Ki2=Ki2,Kd2=0; When Thmax≤Curvalue2: Kp2=10*Kp2, Ki2=Ki2, Kd2=0; Among them, Kp20 and Ki20 are the stacking proportion coefficient and stacking differential coefficient corresponding to the last updated sampling residence time; Thmin and Thmax are the lower limit and upper limit of the stacking degree threshold respectively; S73, calculate the output out2 of the PID controller: Out2=Kp2*Errvalue2+Ki2*Intvalue2+Kd2*Dervalue2.

2. The pollen automatic sampling and anti-stacking control method according to claim 1, characterized in that: Step S2 further comprises: S21. Calculate the gray value Gray of each pixel in the gray image: Gray=0.299*R+0.587*G+0.114*B Among them, R, G, and B are the values ​​of the red, green, and blue channels of each pixel in the grayscale image; S22, setting the pixel points whose grayscale value is less than the grayscale threshold to zero, and setting the pixel points whose grayscale value is greater than or equal to the grayscale threshold to 255; S23, counting the total number of zero pixels in the same grayscale image, and calculating the average value of the total number of pixels of all grayscale images in the same sampling area as the count value.

3. The pollen automatic sampling and anti-stacking control method according to claim 1, characterized in that: Also included between step S42 and step S43: A1, determine whether at least one slide has been collected before the current slide is collected in the current month, if so, proceed to step A2, otherwise directly proceed to step S43; A2. Increase the differential coefficient Kd obtained in step S42 by a preset multiple, and then proceed to step S43.

4. The pollen automatic sampling and anti-stacking control method according to claim 1, characterized in that: The method for obtaining the error correction value comprises: B1, determine whether the error values ​​of at least two slides have been recorded before the current slide is collected in the current month; if so, proceed to step B2, otherwise proceed to step B4; B2. Calculate the average error value of all slides in the current month corresponding to the same sampling area of ​​the current slide; B3, obtaining the error value of the sampling area corresponding to the previous slide of the current sampling area of ​​the current slide, and calculating the average of the error value and the average value as the final error correction value; B4. Use the error value of the previous slide corresponding to the same sampling area of ​​the current slide as the error correction value.

5. The pollen automatic sampling and anti-stacking control method according to any one of claims 1 to 4, characterized in that: The total sampling time for a single slide is one day, and the initial value of the sampling residence time = 24h / N, where N is the total number of initial sampling areas. When sampling pollen, the start time of pollen sampling in each sampling area is counted, and when the timing time is equal to the corresponding sampling time, sampling of the sampling area is stopped.