Water quality detection method and equipment
By using fill lights to obtain the differences in spectral data in water quality detection, the reflectivity of the water body to the light emitted by fill lights is determined, and the problem of large error in water quality detection at night is solved, and high-accurate water quality detection is achieved in low-light environments.
Patent Information
- Application Number
- CN202311767280.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-20
- Publication Date
- 2025-06-20
AI Technical Summary
The existing water quality detection methods are weak at night, resulting in large errors in the spectral data collected by the spectral acquisition equipment, and it is impossible to accurately measure the water quality of the water body.
By setting up fill lights above the water body, the spectral data in the case of irradiation and unirradiation of fill lights are obtained. Using the difference between these two spectral data, the spectrum of diffuse reflection of the light emitted by the fill light is determined through the water body, that is, the pure exit spectrum, so as to accurately measure the reflectivity and water quality of the water body.
It realizes accurate measurement of water quality in water bodies at night or in environments with weak light intensity, and improves the reliability and accuracy of water quality detection.
Smart Images

Figure CN120177378A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine vision technology, and particularly to a water quality detection method and device. Background Art
[0002] Water quality depends on the components of various substances in the water body, such as microorganisms, heavy metals, etc. Since the components of different substances in the water body are different, the reflectivity of the water body to light of different wavelength bands will also be different. Therefore, based on the reflectivity of the water body to light of each wavelength band, the water quality of the water body can be deduced.
[0003] Based on this principle, in the related art, a spectral acquisition device, such as a spectrometer, can be arranged above the water body whose water quality needs to be measured. The light diffusely reflected by the water body is collected by the spectral acquisition device to obtain the spectral data of these lights (hereinafter referred to as spectrum), so as to obtain the reflectivity of the water body to light of each wavelength band, and the water quality of the water body is deduced based on the reflectivity (hereinafter referred to as non-contact spectrometry).
[0004] However, at night, due to the weak intensity of the ambient light, the intensity of the light collected by the spectral acquisition device is weak. At this time, the error of the collected spectral data is large. Therefore, the non-contact spectrometry cannot accurately measure the water quality of the water body at night. Summary of the Invention
[0005] The purpose of the embodiments of this application is to provide a water quality detection method and device to accurately measure the quality of the water body at night. The specific technical solutions are as follows:
[0006] In the first aspect of this application, a water quality detection method is provided. The method includes:
[0007] Obtain the active supplementary light off-water spectrum collected by the spectral acquisition device for the target water body under the irradiation of the supplementary light, and the ambient light off-water spectrum collected by the spectral acquisition device for the target water body when the supplementary light does not irradiate the target water body;
[0008] According to the difference between the active supplementary light off-water spectrum and the ambient light off-water spectrum, determine the spectrum of the light emitted by the supplementary light and diffusely reflected by the target water body as the pure off-water spectrum;
[0009] According to the pure off-water spectrum, determine the original reflectivity of the target water body to light of each wavelength band;
[0010] According to the original reflectivity of the target water body, determine the water quality of the target water body to obtain the water quality detection result of the target water body.
[0011] In a possible embodiment, determining the spectrum of the light emitted by the supplementary light and diffusely reflected by the target water body as the pure water-leaving spectrum according to the difference between the active supplementary light water-leaving spectrum and the ambient light water-leaving spectrum includes:
[0012] Calibrating the active supplementary light water-leaving spectrum and the ambient light water-leaving spectrum to obtain the calibrated ambient light water-leaving spectrum and the calibrated active supplementary light water-leaving spectrum;
[0013] Determining the spectrum of the light emitted by the supplementary light and diffusely reflected by the target water body as the pure water-leaving spectrum according to the difference between the calibrated active supplementary light water-leaving spectrum and the calibrated ambient light water-leaving spectrum;
[0014] Wherein, the calibration methods for the active supplementary light water-leaving spectrum and the ambient light water-leaving spectrum are exactly the same, and include one or more of the following calibration methods:
[0015] Random noise removal calibration, dark current noise removal calibration, spectral response non-linearity calibration.
[0016] In a possible embodiment, determining the original reflectance of the target water body for each band spectrum according to the pure water-leaving spectrum:
[0017] Obtaining the reference spectrum collected by the spectral acquisition device for the calibration component when the supplementary light irradiates the calibration component, wherein the reflectance of each calibration component is known;
[0018] Determining the mapping relationship between the spectrum and the reflectance according to the reflectance of the calibration component and the reference spectrum collected for the calibration component;
[0019] Determining the reflectance corresponding to the pure water-leaving spectrum according to the pure water-leaving spectrum and the mapping relationship as the original reflectance of the target water body.
[0020] In a possible embodiment, the obtaining the reference spectrum collected by the spectral acquisition device for each calibration component when the supplementary light irradiates the calibration component includes:
[0021] Obtaining each reference spectrum collected by the spectral acquisition device for each calibration component when the supplementary light irradiates the calibration component and under different acquisition conditions, wherein the acquisition conditions include the illumination angle of the supplementary light and / or the height of the supplementary light relative to the calibration component;
[0022] The determining the mapping relationship between the spectrum and the reflectance according to the reflectance of the calibration component and the reference spectrum collected for each calibration component includes:
[0023] Determine the mapping relationship between the spectrum, the acquisition conditions, and the reflectivity based on the reflectivity of the calibration component, each acquisition condition, and the reference spectrum acquired under each acquisition condition;
[0024] The determining the reflectivity corresponding to the pure water-leaving spectrum as the original reflectivity of the target water body according to the pure water-leaving spectrum and the mapping relationship includes:
[0025] Obtain the acquisition conditions when the active-light-supplemented water-leaving spectrum and the ambient-light water-leaving spectrum are acquired as the target acquisition conditions;
[0026] Determine the reflectivity corresponding to the pure water-leaving spectrum and the target acquisition conditions according to the pure water-leaving spectrum, the target acquisition conditions, and the mapping relationship as the original reflectivity of the target water body.
[0027] In a possible embodiment, the acquisition conditions further include the exposure time of the spectral acquisition device.
[0028] In a possible embodiment, the determining the water quality of the target water body based on the original reflectivity of the target water body to obtain the water quality detection result of the target water body includes:
[0029] Normalize the original reflectivity of the target water body to obtain the normalized reflectivity of the target water body, where the normalized reflectivity of each band of the target water body is positively correlated with the original reflectivity of the target water body in this band and negatively correlated with the original reflectivity of other bands of the target water body;
[0030] Determine the water quality of the target water body based on the normalized reflectivity of the target water body to obtain the water quality detection result of the target water body.
[0031] In a second aspect of the present application, a water quality detection device is provided. The water quality detection device includes: a supplementary light, a spectral acquisition device, and a processor;
[0032] The supplementary light is used to irradiate the target water body when it is turned on, so that the light emitted by the supplementary light is incident on the spectral acquisition device through the diffuse reflection of the target water body;
[0033] The spectral acquisition device is used to acquire the active-light-supplemented water-leaving spectrum of the target water body when the supplementary light is turned on and acquire the ambient-light water-leaving spectrum of the target water body when the supplementary light is turned off; and send the active-light-supplemented water-leaving spectrum and the ambient-light water-leaving spectrum to the processor;
[0034] The processor is configured to determine, based on the difference between the active supplementary lighting water-leaving spectrum and the ambient light water-leaving spectrum, the spectrum of the light emitted by the supplementary light and diffusely reflected by the target water body as the pure water-leaving spectrum; determine the original reflectance of the target water body for light of each band according to the pure water-leaving spectrum; and determine the water quality of the target water body based on the original reflectance of the target water body to obtain the water quality detection result of the target water body.
[0035] In a possible embodiment, the water quality detection device further includes a skylight acquisition device;
[0036] The skylight acquisition device is configured to acquire the light intensity of skylight; send an on request to the supplementary light in response to the light intensity of skylight being lower than a preset lower light intensity threshold; and send an off request to the supplementary light in response to the light intensity of skylight being higher than a preset upper light intensity threshold.
[0037] The supplementary light is further configured to turn on in response to the supplementary lighting request; and turn off in response to the off request.
[0038] In a possible embodiment, a calibration file is pre-stored in the supplementary light, and the calibration file is used to represent the mapping relationship between the spectrum, the acquisition conditions, and the reflectance.
[0039] The processor determines the original reflectance of the target water body for light of each band according to the pure water-leaving spectrum, including:
[0040] Obtain the mapping relationship represented by the calibration file and the acquisition conditions when the active supplementary lighting water-leaving spectrum and the ambient light water-leaving spectrum are acquired, as the target acquisition conditions.
[0041] Determine the reflectance corresponding to the pure water-leaving spectrum and the target acquisition conditions according to the pure water-leaving spectrum, the target acquisition conditions, and the mapping relationship as the original reflectance of the target water body.
[0042] Wherein, the mapping relationship is obtained in the following way in advance:
[0043] Obtain the reference spectra of each calibration component acquired by the spectrum acquisition device for each calibration component when the supplementary light irradiates the calibration component under different acquisition conditions; determine the mapping relationship between the spectrum, the acquisition conditions, and the reflectance according to the reflectance of the calibration component, each acquisition condition, and the reference spectra acquired under each acquisition condition; wherein, the acquisition conditions include the illumination angle of the supplementary light and / or the height of the supplementary light relative to the calibration component.
[0044] In a possible embodiment, the included angle between the optical axis of the supplementary light and the central optical axis of the spectral acquisition device is less than a preset included angle threshold;
[0045] The supplementary light is a continuous light source, and its spectrum covers the 400 - 1000 nm band;
[0046] The optical resolution of the spectral acquisition device is not greater than 2 nm, and its spectral range covers the 400 - 1000 nm band;
[0047] The angle between the optical axis of the supplementary light and the horizontal line of the target water body is between 20° and 70°.
[0048] Advantages of the embodiments of the present application:
[0049] The water quality detection method and device provided by the embodiments of the present application can irradiate the target water body with a supplementary light, so that the spectral acquisition device can collect the active supplementary light off - water spectrum and the ambient light off - water spectrum respectively with and without the supplementary light. The light incident on the spectral acquisition device without the supplementary light can be regarded as ambient light, and the light incident on the spectral acquisition device with the supplementary light can be regarded as ambient light + the light emitted by the supplementary light and diffusely reflected by the target water body. That is, the active supplementary light off - water spectrum can be regarded as the spectrum formed by ambient light + the light emitted by the supplementary light diffusely reflected by the water body, while the ambient light off - water spectrum can be regarded as the spectrum formed by ambient light. Therefore, based on the difference between the two, the spectrum of the light emitted by the supplementary light and diffusely reflected by the target water body, that is, the pure off - water spectrum, can be determined. Thus, based on the pure off - water spectrum, the reflectivity of the target water body can be accurately determined, and the water quality of the target water body can be deduced based on the reflectivity. Since this solution determines the reflectivity based on the pure off - water spectrum, and the pure off - water spectrum is the spectrum of the light emitted by the supplementary light, even in a scenario with weak ambient light intensity at night, this solution can accurately measure the water quality.
[0050] Of course, it is not necessary for any product or method implementing the present application to achieve all the above - mentioned advantages simultaneously. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following - described drawings are only some embodiments of the present application, and those of ordinary skill in the art can also obtain other embodiments based on these drawings.
[0052] Figure 1 It is a schematic flowchart of a water quality detection method provided by the present application;
[0053] Figure 2aSchematic diagram of the integrated spectral acquisition device and fill light provided by this application;
[0054] Figure 2b Schematic diagram of the independent spectral acquisition device and fill light provided by this application;
[0055] Figure 3 Schematic diagram of a reflectance curve provided by this application;
[0056] Figure 4 Schematic diagram of a process for obtaining a pure water-leaving spectrum provided by this application;
[0057] Figure 5 Schematic diagram of a process for determining the original reflectance based on the pure water-leaving spectrum provided by this application;
[0058] Figure 6 Schematic diagram of a process for determining the mapping relationship provided by this application;
[0059] Figure 7 Schematic diagram of a process for determining the water quality detection result based on the original reflectance provided by this application;
[0060] Figure 8 Another schematic diagram of the water quality detection method provided by this application;
[0061] Figure 9 Schematic diagram of a structure of the water quality detection device provided by this application;
[0062] Figure 10 Another schematic diagram of a structure of the water quality detection device provided by this application;
[0063] Figure 11 Another schematic diagram of a structure of the water quality detection device provided by this application. Detailed implementation manners
[0064] Next, the technical solutions in the embodiments of this application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art based on this application belong to the scope protected by this application.
[0065] To more clearly illustrate the water quality detection method provided by this application, an exemplary description will be given below of a possible application scenario of the water quality detection method provided by this application. It can be understood that the following examples are only a possible application scenario of the water quality detection method provided by this application. In other possible embodiments, the water quality detection method provided by this application can also be applied to other possible application scenarios, and the following examples do not impose any restrictions on this.
[0066] In order to effectively investigate the ecology of a certain reservoir, users need to obtain the water quality of the reservoir all day long for the next month. Currently, the conventional water quality detection methods on the market are: electrochemical method, contact optical method, chemical method, non-contact spectroscopy method. Among them, the service life of the equipment used in the electrochemical method and the contact optical method is often short, and users need to go to the reservoir multiple times within a month to deploy the equipment. The chemical method may cause pollution to the measured water body. Therefore, the user finally decides to choose the non-contact spectroscopy method.
[0067] In the related art, the non-contact spectroscopy method only requires the user to set up spectrometers at one or more points of the reservoir, and the service life of the spectrometers is much longer than one month. Therefore, the user only needs to deploy the equipment once to complete the water quality detection within one month. However, the spectrum collected by the spectrometer is essentially the light intensity of each wavelength band. In situations such as at night and on rainy days, the light intensity of the ambient light is weak. Therefore, the light intensity of the light incident on the spectrometer is low, and at this time, the light intensity of each wavelength band is also low. At this time, the background noise, random fluctuations in the performance of the spectrometer, etc. will cause large fluctuations in the measured light intensity, that is, the accuracy of the spectrum measured by the spectrometer at this time is low.
[0068] Therefore, based on the spectrum collected by the spectrometer deployed in the reservoir, the user can only accurately calculate the water quality of the reservoir water during the daytime with sufficient light, but cannot obtain the water quality at night and on rainy days. It can be seen that the user cannot accurately obtain the water quality all day long within one month, and thus cannot complete the ecological investigation.
[0069] Based on this, the present application provides a water quality detection method, as Figure 1 shown, including:
[0070] Step S101, obtaining the active supplementary light off-water spectrum obtained by the spectrum acquisition device collecting the target water body under the condition that the supplementary light lamp irradiates the target water body, and the ambient light off-water spectrum obtained by the spectrum acquisition device collecting the target water body under the condition that the supplementary light lamp does not irradiate the target water body.
[0071] Step S102, according to the difference between the active supplementary light off-water spectrum and the ambient off-water spectrum, determining the spectrum of the light emitted by the supplementary light lamp and diffusely reflected by the target water body as the pure off-water spectrum.
[0072] Step S103, according to the pure off-water spectrum, determining the original reflectivity of the target water body to the light of each wavelength band.
[0073] Step S104, according to the original reflectivity of the target water body, determining the water quality of the target water body to obtain the water quality detection result of the target water body.
[0074] By using the water quality detection method provided in this application, the target water body can be irradiated by a supplementary light to enable the spectral acquisition device to collect the active supplementary light off-water spectrum and the ambient light off-water spectrum respectively under the conditions of being irradiated by the supplementary light and not being irradiated by the supplementary light. The light incident on the spectral acquisition device without the irradiation of the supplementary light can be regarded as ambient light, while the light incident on the spectral acquisition device with the irradiation of the supplementary light can be regarded as the ambient light plus the light emitted by the supplementary light and diffusely reflected by the target water body. That is, the active supplementary light off-water spectrum can be regarded as the spectrum formed by the light emitted by the supplementary light diffusely reflected by the water body, and the ambient light off-water spectrum can be regarded as the spectrum formed by the ambient light. Therefore, based on the difference between the two, the spectrum of the light emitted by the supplementary light and diffusely reflected by the target water body, that is, the pure off-water spectrum, can be determined. Thus, based on the pure off-water spectrum, the reflectivity of the target water body can be accurately determined, and the water quality of the target water body can be deduced based on the reflectivity. Since this solution determines the reflectivity based on the pure off-water spectrum, and the pure off-water spectrum is the spectrum of the light emitted by the supplementary light, even in a scenario with weak ambient light intensity at night, this solution can accurately measure the water quality.
[0075] The following will separately elaborate on steps S101 - S104 in detail:
[0076] In step S101, the supplementary light and the spectral acquisition device can be integrated as shown in Figure 2a or can exist independently as shown in Figure 2b . Figure 2a And Figure 2b show schematic diagrams of two different supplementary light methods provided in this application, including a supplementary light 210 and a spectral acquisition device 220. Among them, the light emitted by the supplementary light 210 needs to be able to irradiate the target water body, and the diffuse reflection by the target water body needs to be able to be incident on the spectral acquisition device 220. Regarding how to make the light emitted by the supplementary light 210 be diffusely reflected by the target water body and be incident on the spectral acquisition device 220, it will be described below and will not be elaborated here.
[0077] The active supplementary light off-water spectrum and the ambient light off-water spectrum should be obtained by the same spectral acquisition device for the same target water body. And when obtaining the active supplementary light off-water spectrum and the ambient light off-water spectrum, there should be only the difference of whether the supplementary light is irradiated as much as possible. That is, except for the condition of whether the supplementary light is irradiated, the active supplementary light off-water spectrum and the ambient light off-water spectrum should be obtained under as identical acquisition conditions as possible.
[0078] For example, if the water level is 3 m when the active supplementary light water-leaving spectrum is collected, the water level when the ambient light water-leaving spectrum is collected should also be as close as possible to 3 m or around 3 m. Another example is that if the moon is covered by clouds when the active supplementary light water-leaving spectrum is collected, the moon should also be in a state of being blocked by clouds when the ambient light water-leaving spectrum is collected.
[0079] It can be understood that it can be considered that the acquisition conditions will not change in a short period of time. Therefore, in order to make the acquisition conditions as identical as possible when collecting the active supplementary light water-leaving spectrum and the ambient light water-leaving spectrum, the active supplementary light water-leaving spectrum and the ambient light water-leaving spectrum should be collected separately within the shortest possible time. For example, it can be to first turn on the supplementary light and collect the target water body through the spectral acquisition device to obtain the active supplementary light water-leaving spectrum, and then immediately turn off the supplementary light and collect the target water body through the spectral acquisition device to obtain the ambient light water-leaving spectrum. Another example is that it can also be to first turn off the supplementary light and collect the target water body through the spectral acquisition device to obtain the ambient light water-leaving spectrum, and then immediately turn on the supplementary light and collect the target water body through the spectral acquisition device to obtain the active supplementary light water-leaving spectrum.
[0080] In step S202, although the light intensity of the ambient light is weak at night, on rainy days, etc., there is still ambient light. Therefore, even when the supplementary light is irradiating the target water body, the light incident on the spectral acquisition device is not only the light emitted by the supplementary light and diffusely reflected by the target water body, but also includes the directly incident ambient light, the ambient light reflected by the water body, and the ambient light reflected by other objects in the environment (such as trees, the ground, etc.). For the convenience of description below, these lights are collectively referred to as ambient light. Therefore, it is impossible to determine the reflectivity of the target water body to the light of each band only based on the active supplementary light water-leaving spectrum collected when the supplementary light irradiates the target water body.
[0081] And the aforementioned ambient light will also be incident on the spectral acquisition device when the supplementary light is not irradiating the target water body. Therefore, the ambient light water-leaving spectrum collected when the supplementary light is not irradiating the target water body can reflect the spectrum of this ambient light. Similarly, the aforementioned active supplementary light water-leaving spectrum can reflect the spectrum of the ambient light + the light emitted by the supplementary light and diffusely reflected by the target water body. Therefore, the difference between the two is the spectrum of the light emitted by the supplementary light and diffusely reflected by the target water body, that is, the pure water-leaving spectrum can be regarded as the spectrum of the light emitted by the supplementary light and diffusely reflected by the target water body.
[0082] Regarding how to calculate the difference between the active supplementary light water-leaving spectrum and the ambient light water-leaving spectrum to obtain the pure water-leaving spectrum, detailed examples will be given below and will not be elaborated here.
[0083] In step S203, theoretically, the higher the reflectivity of the target water body to the light of a certain band, the stronger the light of this band in the light diffusely reflected by the target water body. That is, the reflectivity of the target water body can be calculated based on the light intensity. The pure water-leaving spectrum can be regarded as the spectrum of the supplementary light emitted and diffusely reflected by the target water body. Therefore, the pure water-leaving spectrum can reflect the light intensity of each band in the light of the supplementary light emitted and diffusely reflected by the target water body. Thus, the reflectivity of the target water body can be calculated based on the pure water-leaving spectrum. Subsequently, the water quality detection result of the target water body can be directly calculated based on this reflectivity, or the reflectivity can be processed first, and then the water quality detection result of the target water body can be calculated based on the processed reflectivity. To distinguish the processed reflectivity in the following text, the reflectivity determined in step S203 is referred to as the original reflectivity in this article.
[0084] It can be understood that the original reflectivity is not a single reflectivity value, but a set of reflectivities of the target water body to the light of different bands. Exemplarily, the original reflectivity can be a set composed of the reflectivity of the target water body to the light of the 400nm band, the reflectivity of the target water body to the light of the 401nm band,..., the reflectivity of the target water body to the light of the 900nm band. The original reflectivity can be represented as a reflectivity curve as shown in Figure 3 where the abscissa is the band and the ordinate is the reflectivity, and the curve is used to represent the reflectivity of the target water body to the light of each band. Similarly, the normalized reflectivity in the following text is not a single reflectivity value, but a set of reflectivities of the target water body to the light of different bands, and can also be regarded as a reflectivity curve.
[0085] In step S204, as described above, the water quality of the target water body can be determined directly based on the original reflectivity. For example, the original reflectivity is substituted into an equation with the reflectivity as the independent variable and the water quality detection result as the dependent variable that is pre-constructed, so as to obtain the water quality detection result of the target water body. It can also be to first perform some processing on the original reflectivity, including but not limited to normalization, noise reduction processing, and smoothing processing, and then input the processed reflectivity into a pre-trained water quality prediction model to obtain the water quality detection result output by the water quality prediction model. Regarding when the original reflectivity needs to be processed and how to process the original reflectivity, it will be described below.
[0086] The form of the water quality detection result can be different according to different application scenarios, and this application does not impose any restrictions on this. For example, the water quality detection result can be expressed in the form of excellent, good, ordinary, poor, very poor, or can be expressed in the form of scores of the target water body on each water quality index. Exemplarily, the water quality detection result can be: turbidity, 8 points; visible matter content, 4 points; metal content, 7 points.
[0087] The above has separately described steps S201 - S204. Below, a detailed example of how to obtain the pure water - leaving spectrum in the aforementioned step S202 will be given:
[0088] As described above, the actively - supplemented light water - leaving spectrum can be regarded as the ambient light spectrum + the pure water - leaving spectrum, and the ambient light water - leaving spectrum can be regarded as the ambient light spectrum. Therefore, in theory, the pure water - leaving spectrum can be obtained by directly taking the difference between the two. Thus, in one possible embodiment, it can be to directly subtract the ambient light water - leaving spectrum from the actively - supplemented light water - leaving spectrum, and take the obtained difference as the pure water - leaving spectrum.
[0089] However, it can be understood that due to various limiting conditions, there is a certain amount of noise in both the actively - supplemented light water - leaving spectrum and the ambient light water - leaving spectrum. To distinguish the noise in the actively - supplemented light water - leaving spectrum and the ambient light water - leaving spectrum, the noise in the actively - supplemented light water - leaving spectrum is called the first noise, and the noise in the ambient light water - leaving spectrum is called the second noise. Then the actively - supplemented light water - leaving spectrum is actually the ambient light spectrum + the pure water - leaving spectrum + the first noise, and the ambient light water - leaving spectrum is actually the ambient light spectrum + the second noise. And the first noise and the second noise are often different. Therefore, when the difference between the first noise and the second noise is large, the difference obtained by directly subtracting the ambient light water - leaving spectrum from the actively - supplemented light water - leaving spectrum is quite different from the true pure water - leaving spectrum.
[0090] Therefore, in another possible embodiment, the actively - supplemented light water - leaving spectrum and the ambient light water - leaving spectrum can be corrected separately first to remove the first noise and the second noise as much as possible. Since the factors causing noise are different in different situations, the correction methods can also be different in different situations.
[0091] This application provides the following three correction methods:
[0092] Method 1: Filtering processing;
[0093] Including but not limited to filtering through Savitzky - Golay (a filtering method), wavelet filtering, etc.
[0094] Method 2: Dark current correction;
[0095] Method 3: Non - linear correction of spectral response.
[0096] Among them, Method 1 can be used to reduce or even remove random noise, Method 2 can reduce or even remove the noise caused by the dark current of the spectral acquisition device, and Method 3 can reduce or even remove the error caused by the non - linear light conversion curve of the sensing unit in the spectral acquisition device.
[0097] The aforementioned Method 1, Method 2, and Method 3 can be adopted simultaneously. Exemplarily, reference can be made to Figure 4 , Figure 4The following shows a method for obtaining a pure water-leaving spectrum provided by this application. It consists of Figure 4 As can be seen, first, the active light-supplemented water-leaving spectrum and the ambient light water-leaving spectrum are respectively processed in accordance with Method 1, Method 2, and Method 3 in sequence to obtain the corrected active light-supplemented water-leaving spectrum and the corrected ambient light water-leaving spectrum. Then, the corrected active light-supplemented water-leaving spectrum is subtracted from the corrected ambient light water-leaving spectrum to obtain the pure water-leaving spectrum.
[0098] Figure 4 The following shows only one way to obtain the pure water-leaving spectrum provided by this application. In other possible embodiments, only some of the aforementioned three methods may be adopted. Exemplarily, in one possible embodiment, if the dark current can be almost ignored according to the user's experience, then only Method 1 and Method 3 can be adopted to reduce noise. In another possible embodiment, if the dark current can be almost ignored according to the user's experience and the spectral acquisition device always operates in the linear range during the acquisition process, then only Method 1 can be adopted to reduce noise.
[0099] However, for the case of only adopting some methods, the active light-supplemented water-leaving spectrum and the ambient light water-leaving spectrum need to be corrected in exactly the same way. For example, if Method 1 and Method 3 are used to correct the active light-supplemented water-leaving spectrum, then Method 1 and Method 3 also need to be used to correct the ambient light water-leaving spectrum. And if the active light-supplemented water-leaving spectrum is corrected first according to Method 1 and then according to Method 3 during the correction process, then the ambient light water-leaving spectrum should also be corrected first according to Method 1 and then according to Method 3 during the correction process.
[0100] The above has already explained how to obtain the pure water-leaving spectrum. As can be seen from the foregoing explanation, theoretically, the reflectance of the target water body can be calculated when the pure water-leaving spectrum is obtained. However, in the related art, the light source in the non-contact spectroscopic method is skylight, while the light source of the pure water-leaving spectrum in this application is a supplementary light. The light emitted by skylight and the supplementary light is not the same. Therefore, if the reflectance is calculated from the spectrum in the way of the related art, the calculated reflectance may not be accurate enough.
[0101] Based on this, in one possible embodiment, reference can be made to Figure 5 , Figure 5 The following shows a schematic flowchart of a method for calculating reflectance provided by this application, including:
[0102] Step S501: Obtain the reference spectrum collected by the spectral acquisition device for the calibration component when the supplementary light illuminates the calibration component.
[0103] Among them, the calibration component can be any object that can diffusely reflect the light emitted by the supplementary light and has a known reflectance, such as a reflection calibration plate.
[0104] Step S502: Determine the mapping relationship between the spectrum and the reflectivity according to the reflectivity of the calibration component and the reference spectrum obtained by collecting the calibration component.
[0105] From the definition of reflectivity, it can be known that reflectivity = intensity of reflected light / intensity of incident light. Therefore, there is formula (1):
[0106]
[0107] where rs(x) is the reflectivity of the calibration component for the x-band, Is(x) is the light intensity of the x-band in the reference spectrum, and Iins(x) is the light intensity of the x-band in the light emitted by the supplementary light and irradiated on the calibration component. Similarly, there is formula (2):
[0108]
[0109] where r(x) is the reflectivity of the target water body for the x-band, I(x) is the light intensity of the x-band in the pure water-leaving spectrum, and Iin(x) is the light intensity of the x-band in the light emitted by the supplementary light and irradiated on the target water body.
[0110] Combining formula (1) and (2) gives formula (3):
[0111]
[0112] Since both Iins(x) and Iin(x) are the light emitted by the supplementary light, without considering the differences between the two scenarios of the supplementary light irradiating the calibration component and the supplementary light irradiating the target water body, it can be considered that Iins(x) is approximately equal to Iin(x). Therefore, formula (3) can be rewritten as formula (4):
[0113]
[0114] Formula (4) can be regarded as the mapping relationship between the spectrum and the reflectivity. For the case of considering the differences between the two scenarios, reference can be made to the embodiments shown below Figure 6 and will not be elaborated here. Of course, this mapping relationship can be expressed in other forms than formulas, such as tables, linked lists, etc., and this application does not impose any restrictions on this.
[0115] Step S501 and step S502 can be pre-executed before step S101, and it is not necessary to execute step S501 and step S502 every time the water quality detection method provided by the present application is executed. Instead, step S501 and step S502 can be executed only once to obtain the mapping relationship and store it. When the water quality detection method provided by the present application is subsequently executed, step S503 and subsequent steps in the following text are directly executed according to the recorded mapping relationship, and step S501 and step S502 are no longer executed.
[0116] Step S503: Determine the reflectance corresponding to the pure water spectrum as the original reflectance of the target water body according to the pure water spectrum and the mapping relationship.
[0117] Substituting the pure water spectrum into the above formula (4) can obtain the reflectance of the target water body.
[0118] It can be understood that since the mapping relationship is determined according to the reflectance of the calibration component and the reference spectra collected from each calibration component, and the reference spectra are obtained by the spectral acquisition device actually collecting the light emitted by the supplementary light and diffusely reflected by the calibration component, the mapping relationship can accurately reflect the relationship between the spectrum and the reflectance of the light emitted by the supplementary light. Therefore, the original reflectance calculated according to the mapping relationship is relatively accurate.
[0119] That is to say, by selecting this embodiment, a mapping relationship applicable to the supplementary light for calculating the reflectance according to the spectrum can be obtained by calibrating the supplementary light, so that the original reflectance can be accurately determined according to the mapping relationship, thereby improving the accuracy of water quality detection.
[0120] It can be understood that skylight can be regarded as light emitted from a high place. Therefore, the distance between the light source and the water body under the skylight illumination is often much greater than the water level height. Therefore, the rise and fall of the water level will not affect the height of the light source relative to the water body. At the same time, skylight can always be approximately regarded as vertically irradiating on the water body. That is to say, in the case of skylight, the height of the light source relative to the water body and the irradiation angle of the light source can be regarded as fixed values. Different from skylight, in the case of the supplementary light, the height of the supplementary light relative to the water body is not much greater than the water level height. Therefore, the rise and fall of the water level will not affect the height of the supplementary light relative to the water body. Similarly, according to the installation position of the supplementary light, the irradiation angle of the supplementary light will also change.
[0121] When the reflectivity of the target water body remains unchanged, both the relative height of the fill light and the irradiation angle of the fill light may affect the spectrum collected by the spectral acquisition device. That is, when the relative height of the fill light and the irradiation angle of the fill light are different, the true relationship between the pure water-leaving spectrum and the original reflectivity is different. Therefore, the mapping relationship obtained in the previous text may only be applicable to specific situations, and it is often difficult for users to know the relative height of the fill light and the irradiation angle of the fill light when the spectral acquisition device collects the target water body. Therefore, users cannot determine whether the situation to which the mapping relationship obtained in the previous text applies is consistent with the actual situation. If they are not consistent, the reflectivity determined according to this mapping relationship will also be inaccurate, which will in turn lead to inaccurate water quality detection results.
[0122] Based on this, in a possible embodiment, reference can be made to Figure 6 , including:
[0123] Step S601, obtain the reference spectra collected by the spectral acquisition device for each calibration component when the fill light irradiates the calibration component and is under different acquisition conditions.
[0124] Among them, the acquisition conditions include the illumination angle of the fill light and / or the height of the fill light relative to the calibration component. The illumination angle refers to the angle between the optical axis of the fill light and the object being irradiated. Regarding the height and illumination angle, reference can be made to Figure 2a as shown, Figure 2a in which H is the height of the fill light relative to the water body, and a is the illumination angle of the fill light. Although Figure 2a shows the height of the fill light relative to the water body, the height of the fill light relative to the calibration component is the same by analogy.
[0125] Step S602, determine the mapping relationship between the spectrum, the acquisition conditions, and the reflectivity according to the reflectivity of the calibration component, each acquisition condition, and the reference spectra collected under each acquisition condition.
[0126] In a possible embodiment, it may be to construct the mapping relationship between the spectrum and the reflectivity under different acquisition conditions respectively according to the foregoing formula (4) for different acquisition conditions. Is(x) in formula (4) obtained under each acquisition condition is: the light intensity of the x band in the reference spectrum collected under this acquisition condition.
[0127] In another possible embodiment, considering that both Iins(x) and Iin(x) in the foregoing formula (3) are affected by the acquisition conditions, formula (3) can be rewritten as formula (5):
[0128]
[0129] Among them, C is the acquisition condition, and the function g is a function with the acquisition condition and the wavelength band as independent variables. Substitute the reference spectra collected under different acquisition conditions, the reflectivities of each acquisition condition and the calibration component into formula (5) to obtain multiple equations. Fit the obtained multiple equations to determine the function g. Substitute the determined function g into formula (5) to obtain the mapping relationship between the spectrum, the acquisition condition, and the reflectivity.
[0130] Step S601 and step S602 can be pre-executed before step S101, and it is not necessary to execute step S601 and step S602 every time the water quality detection method provided by this application is executed. Instead, step S601 and step S602 can be executed only once to obtain the mapping relationship and store it. When the water quality detection method provided by this application is subsequently executed, directly execute step S503 and subsequent steps according to the recorded mapping relationship, and no longer execute step S601 and step S602.
[0131] Step S603, obtain the acquisition condition when the actively supplemented light off-water spectrum and the ambient light off-water spectrum are collected as the target acquisition condition.
[0132] The target acquisition condition can be measured or deduced. Exemplarily, taking the aforementioned height as an example, a component with a ranging function can be set on the supplementary light, and the distance between the supplementary light and the target water body in the vertical direction can be measured by this component as the height. It can also be to set a component with a water level monitoring function at the target water body, measure the water level of the target water body, and deduce the aforementioned height based on the water level of the target water body and the installation height of the supplementary light.
[0133] Step S604, determine the reflectivity corresponding to the pure off-water spectrum and the target acquisition condition according to the pure off-water spectrum, the target acquisition condition, and the mapping relationship as the original reflectivity of the target water body.
[0134] For the case where the mapping relationship is the aforementioned formula (5), substitute the pure off-water spectrum and the target acquisition condition into formula (5) to obtain the original reflectivity.
[0135] For the case where the mapping relationship is the mapping relationship between the spectra and the reflectivities under the aforementioned different acquisition conditions, the mapping relationship between the spectra and the reflectivities under different acquisition conditions can be queried to determine the mapping relationship between the spectra and the reflectivities under the target acquisition condition, obtain the formula shown in the aforementioned formula (4), and then substitute the pure off-water spectrum into formula (4) to obtain the original reflectivity of the target water body.
[0136] This embodiment is selected by fully considering the influence of acquisition conditions on the spectrum. By separately acquiring the reference spectra of the calibration component under different acquisition conditions, a mapping relationship applicable to different acquisition conditions can be obtained. Furthermore, the reflectance of the target water body can be relatively accurately calculated based on the pure water-leaving spectra obtained under different acquisition conditions.
[0137] It can be understood that in addition to the height and irradiation angle of the aforementioned supplementary light, which may affect the mapping relationship, the exposure parameters of the spectral acquisition device may also affect the mapping relationship. Therefore, in a possible embodiment, the acquisition conditions in the foregoing may further include the exposure parameters of the spectral acquisition device.
[0138] Although the mapping relationship obtained through the Figure 6 example shown can be applicable to different acquisition conditions, there will still be a certain error due to ignoring the acquisition conditions during the process of calculating the original reflectance. To eliminate the error in the original reflectance, in a possible embodiment, the original reflectance can be processed according to the steps mentioned in the foregoing step S204.
[0139] Exemplarily, reference can be made to Figure 7 , including:
[0140] Step S701: Normalize the original reflectance of the target water body to obtain the normalized reflectance of the target water body.
[0141] Among them, the normalized reflectance of each band of the target water body is positively correlated with the original reflectance of the target water body in this band. Exemplarily, assuming that the optical resolution of the spectral acquisition device is 1 nm and the spectral range is 400 - 900 nm, the original reflectance can be regarded as the set {r(400), r(401), …, r(900)}, where r(400) is the original reflectance of band 400 nm, r(401) is the original reflectance of band 401 nm, and so on.
[0142] Then the normalized reflectance of band x can be calculated according to formula (6):
[0143]
[0144] Among them, R(x) is the normalized reflectance of band x.
[0145] The normalized reflectance of band x can be calculated according to formula (7):
[0146]
[0147] Among them, rmax is the maximum value in the set {r(400), r(401), …, r(900)}.
[0148] Step S702: Determine the water quality of the target water body based on the normalized reflectance of the target water body, and obtain the water quality detection result of the target water body.
[0149] It can be understood that during the normalization process, the influence brought by different acquisition conditions can be eliminated to a certain extent. Therefore, the calculated normalized reflectance is closer to the true reflectance of the target water body, and the water quality detection result calculated based on the normalized reflectance is more accurate.
[0150] The above has separately described how to obtain the pure water-leaving spectrum, how to obtain the original reflectance based on the pure water-leaving spectrum, and how to obtain the water quality detection result based on the original reflectance. Next, in order to more clearly illustrate the water quality detection method provided by this application, the complete process of the water quality detection method provided by this application will be exemplarily described in combination with the foregoing processes, which can be seen Figure 8 .
[0151] Figure 8 The method for obtaining the pure water-leaving spectrum represented by the left branch in Figure 4 is the same as that in Figure 8 . Details will not be repeated here. As can be seen from the right branch in Figure 8 , in the example shown in Figure 6 , first, a reference spectrum is obtained, and the reference spectrum is corrected for the illumination angle and height, and then corrected for the exposure parameters of the spectral acquisition device to obtain the corrected reference spectrum, that is, the mapping relationship between the spectrum and the reflectance applicable to different acquisition conditions is obtained according to the relevant description in the foregoing Figure 8 . Since the process represented by the right branch in Figure 6 is the example shown in the foregoing
[0152] In Figure 8 , the left branch can determine the mapping relationship according to the corrected reference spectrum based on the pure water-leaving spectrum obtained by the left branch and the corrected reference spectrum obtained by the right branch, and determine the original reflectance according to the mapping relationship and the pure water-leaving spectrum.
[0153] Then, the original reflectance is normalized to obtain the normalized reflectance, and further, the water quality detection result is determined according to the normalized reflectance. The process from the original reflectance to the water quality detection result can be seen in the example shown in the foregoing Figure 7 . Details will not be repeated here.
[0154] Corresponding to the foregoing water quality detection method, this application also provides a water quality detection device, as shown in Figure 9 , including a fill light 210, a spectral acquisition device 220, and a processor 230;
[0155] The supplementary light 210 is used to irradiate the target water body when it is turned on, so that the light emitted by the supplementary light is incident on the spectral acquisition device 220 through the diffuse reflection of the target water body;
[0156] The spectral acquisition device 220 is used to collect the target water body to obtain the active supplementary light off-water spectrum when the supplementary light is turned on, and collect the target water body to obtain the ambient light off-water spectrum when the supplementary light is turned off; send the active supplementary light off-water spectrum and the ambient light off-water spectrum to the processor 230;
[0157] The processor 230 is used to determine the spectrum of the light emitted by the supplementary light and incident on the spectral acquisition device through the diffuse reflection of the target water body as the pure off-water spectrum according to the difference between the active supplementary light off-water spectrum and the ambient light off-water spectrum; determine the original reflectivity of the target water body to the light of each band according to the pure off-water spectrum; determine the water quality of the target water body according to the original reflectivity of the target water body to obtain the water quality detection result of the target water body. That is, data processing → reflectivity calculation → water quality detection.
[0158] By using the water quality detection device provided in this application, the target water body can be irradiated by the supplementary light 210, so that the spectral acquisition device can collect the active supplementary light off-water spectrum and the ambient light off-water spectrum respectively under the conditions of being irradiated by the supplementary light and not being irradiated by the supplementary light. The light incident on the spectral acquisition device without the supplementary light can be regarded as ambient light, while the light incident on the spectral acquisition device with the supplementary light can be regarded as ambient light + the light emitted by the supplementary light and incident on the spectral acquisition device through the diffuse reflection of the target water body. That is, the active supplementary light off-water spectrum can be regarded as the spectrum formed by the ambient light + the light emitted by the supplementary light and incident on the spectral acquisition device through the diffuse reflection of the water body, while the ambient light off-water spectrum can be regarded as the spectrum formed by the ambient light. Therefore, based on the difference between the two, the spectrum of the light emitted by the supplementary light and incident on the spectral acquisition device through the diffuse reflection of the target water body, that is, the pure off-water spectrum, can be determined. Thus, based on the pure off-water spectrum, the reflectivity of the target water body can be accurately determined, and the water quality of the target water body can be deduced based on the reflectivity. Since this solution determines the reflectivity based on the pure off-water spectrum, and the pure off-water spectrum is the spectrum of the light emitted by the supplementary light, even in a scenario where the ambient light intensity is weak at night, this solution can accurately measure the water quality.
[0159] As described above, the water quality detection device provided in this application can accurately measure the water quality in a scenario where the ambient light intensity is weak at night. However, if the supplementary light is also turned on when the ambient light intensity is strong during the day, it may affect the accuracy of the water quality detection device in measuring the water quality during the day.
[0160] Based on this, in a possible embodiment, as Figure 10 shown, the water quality detection device further includes a skylight acquisition device 240;
[0161] The skylight acquisition device 240 is configured to acquire the intensity of skylight; in response to the intensity of skylight being lower than a preset lower limit intensity threshold, send an on request to the supplementary light 210; and in response to the intensity of skylight being higher than a preset upper limit intensity threshold, send an off request to the supplementary light 210;
[0162] The supplementary light 210 is further configured to turn on in response to the supplementary light request and turn off in response to the off request.
[0163] In this embodiment, the preset lower limit intensity threshold and the preset upper limit intensity threshold can be set according to the user's experience or actual needs, but the preset lower limit intensity threshold should not be greater than the preset upper limit intensity threshold. Moreover, the preset lower limit intensity threshold can be equal to the preset upper limit intensity threshold. In this case, it is equivalent to the skylight acquisition device 240 controlling the supplementary light 210 to turn on when the light intensity is less than a specific threshold, and the skylight acquisition device 240 controlling the supplementary light 210 to turn off when the light intensity is greater than the specific threshold.
[0164] Selecting this embodiment can make the supplementary light turn on automatically when the skylight intensity is weak and turn off automatically when the skylight intensity is strong. Thus, accurate water quality measurement can be achieved at night, and at the same time, it is avoided that the supplementary light turns on when the skylight intensity is strong, which affects the accuracy of the water quality detection device in measuring water quality during the day. Therefore, selecting this embodiment can enable the water quality detection device to accurately measure the water quality both during the day and at night.
[0165] As described in the foregoing regarding steps S501 and S502, the mapping relationship can be determined in advance. In one possible embodiment, this mapping relationship can be pre-stored in the processor 230. However, if the supplementary light 210 is replaced, the mapping relationship stored in the processor 230 needs to be modified correspondingly, resulting in cumbersome operations.
[0166] Based on this, in another possible embodiment, as Figure 11 shown, the mapping relationship is pre-stored in the supplementary light 210 in the form of a calibration file. In this embodiment, the processor 230 determines the original reflectance of the target water body for each band of light according to the pure water-leaving spectrum, including:
[0167] Obtain the mapping relationship represented by the calibration file and obtain the acquisition conditions when the active supplementary light water-leaving spectrum and the ambient light water-leaving spectrum are acquired as the target acquisition conditions;
[0168] According to the pure water-leaving spectrum, the target acquisition conditions, and the mapping relationship, determine the reflectance corresponding to the pure water-leaving spectrum and the target acquisition conditions as the original reflectance of the target water body;
[0169] Among them, the mapping relationship is obtained in advance in the following way:
[0170] Obtain the reference spectra collected by the spectral acquisition device for each of the calibration components when the supplementary light source irradiates the calibration component assembly under different acquisition conditions; determine the mapping relationship between the spectrum, the acquisition conditions, and the reflectivity according to the reflectivity of the calibration component, each acquisition condition, and the reference spectra collected under each acquisition condition; where the acquisition conditions include the illumination angle of the supplementary light source and / or the height of the supplementary light source relative to the calibration component.
[0171] Selecting this embodiment, since the mapping relationship is pre-stored in the supplementary light source 210, after replacing the supplementary light source 210, the new supplementary light source 210 will also store the mapping relationship applicable to the new supplementary light source 210, and there is no need to update the mapping relationship separately, reducing the operation complexity.
[0172] Each parameter of the spectral acquisition device provided by this application can be set according to actual needs, but the following conditions should be met:
[0173] The angle between the optical axis of the supplementary light source 210 and the central optical axis of the spectral acquisition device 220 should be as small as possible. In this article, as small as possible means less than a preset angle threshold, and the preset angle threshold can be set according to actual experience or requirements. For example, the preset angle threshold can be 2°, or 4°, or other values.
[0174] The supplementary light source 210 should be a continuous light source, and the spectrum should cover the wavelength band required for water quality detection, such as the 400 - 1000nm wavelength band. Similarly, the spectral range of the spectral acquisition device 220 should also cover the wavelength band required for water quality detection. However, the spectral range of the spectral acquisition device 220 and the spectral range of the supplementary light source 210 may not be exactly the same. For example, the spectral range of the spectral acquisition device 220 is 400 - 1000nm, while the spectral range of the supplementary light source 210 is 300 - 1100nm.
[0175] The optical resolution of the spectral acquisition device should be as small as possible. In this article, as small as possible means less than a preset resolution threshold, and the preset resolution threshold can be set according to actual experience or requirements. For example, the preset resolution threshold can be 2nm, or 3nm, or other values.
[0176] The angle between the optical axis of the supplementary light source 210 and the horizontal line of the target water body should be such that the light directly reflected by the target water body cannot enter the spectral acquisition device 220, while the light diffusely reflected by the target water body can enter the spectral acquisition device 220. Exemplarily, the angle can be 20° to 70°, such as 37°, 42°, etc.
[0177] In a possible embodiment, the parameters of the spectral acquisition device can be as shown in Table 1:
[0178] Table 1. Parameter Table of Spectral Acquisition Device
[0179] Sensor type Linear array CMOS Spectral range 400 - 1000nm Dark noise 13RMS@13℃ Optical resolution ≤2nm Signal - to - noise ratio >1800:1 Entrance slit width 50μm ADC bit depth 16bit Operating temperature -10℃ to +50℃ Operating humidity <90% RH
[0180] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0181] The communication interface is used for communication between the above electronic device and other devices.
[0182] The memory can include a Random Access Memory (RAM), and can also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located far from the aforementioned processor.
[0183] The above-mentioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0184] In another embodiment provided by the present application, a computer-readable storage medium is also provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above water quality detection methods are implemented.
[0185] In another embodiment provided by the present application, a computer program product containing instructions is also provided. When it runs on a computer, it causes the computer to execute any of the water quality detection methods in the above embodiments.
[0186] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a solid-state disk (SSD), etc.
[0187] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article, or device including the element.
[0188] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the partial description of the method embodiments for the relevant parts.
[0189] The above are only the preferred embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application are all included in the protection scope of the present application.
Claims
1. A water quality detection method, characterized in that, The method includes: Obtaining an active supplementary light water-leaving spectrum obtained by the spectral acquisition device for the target water body under the irradiation of the supplementary light lamp, and an ambient light water-leaving spectrum obtained by the spectral acquisition device for the target water body when the supplementary light lamp does not irradiate the target water body; Determining the spectrum of the light emitted by the supplementary light lamp and diffusely reflected by the target water body as the pure water-leaving spectrum according to the difference between the active supplementary light water-leaving spectrum and the ambient light water-leaving spectrum; Determining the original reflectance of the target water body for light of each band according to the pure water-leaving spectrum; Determining the water quality of the target water body according to the original reflectance of the target water body to obtain the water quality detection result of the target water body.
2. The method according to claim 1, characterized in that, The determining the spectrum of the light emitted by the supplementary light lamp and diffusely reflected by the target water body as the pure water-leaving spectrum according to the difference between the active supplementary light water-leaving spectrum and the ambient light water-leaving spectrum includes: Calibrating the active supplementary light water-leaving spectrum and the ambient light water-leaving spectrum to obtain a calibrated ambient light water-leaving spectrum and a calibrated ambient light water-leaving spectrum; Determining the spectrum of the light emitted by the supplementary light lamp and diffusely reflected by the target water body as the pure water-leaving spectrum according to the difference between the calibrated active supplementary light water-leaving spectrum and the calibrated ambient light water-leaving spectrum; Wherein, the calibration methods for the active supplementary light water-leaving spectrum and the ambient light water-leaving spectrum are exactly the same, and include one or more of the following calibration methods: Filtering processing, dark current correction, spectral response non-linearity correction.
3. The method according to claim 1, characterized in that, The determining the original reflectance of the target water body for each band spectrum according to the pure water-leaving spectrum: Obtaining a reference spectrum obtained by the spectral acquisition device for the calibration component when the calibration component is irradiated by the supplementary light lamp, wherein the reflectance of each calibration component is known; Determining the mapping relationship between the spectrum and the reflectance according to the reflectance of the calibration component and the reference spectrum obtained by collecting the calibration component; Determining the reflectance corresponding to the pure water-leaving spectrum according to the pure water-leaving spectrum and the mapping relationship as the original reflectance of the target water body.
4. The method according to claim 3, characterized in that, The obtaining the reference spectrum obtained by the spectral acquisition device for each calibration component when the calibration component is irradiated by the supplementary light lamp includes: Obtaining each reference spectrum obtained by the spectral acquisition device for each calibration component when the calibration component is irradiated by the supplementary light lamp and under different acquisition conditions, wherein the acquisition conditions include the illumination angle of the supplementary light lamp and / or the height of the supplementary light lamp relative to the calibration component; The determining the mapping relationship between the spectrum and the reflectance according to the reflectance of the calibration component and the reference spectrum obtained by collecting each calibration component includes: Determining the mapping relationship between the spectrum, the acquisition conditions and the reflectance according to the reflectance of the calibration component, each acquisition condition, and the reference spectrum obtained by collection under each acquisition condition; The determining the reflectance corresponding to the pure water-leaving spectrum according to the pure water-leaving spectrum and the mapping relationship as the original reflectance of the target water body includes: Obtain the acquisition conditions when acquiring the active supplementary light water-leaving spectrum and the ambient light water-leaving spectrum, and use them as the target acquisition conditions; According to the pure water-leaving spectrum, the target acquisition conditions, and the mapping relationship, determine the reflectance corresponding to the pure water-leaving spectrum and the target acquisition conditions, and use it as the original reflectance of the target water body.
5. The method according to claim 4, characterized in that, The acquisition conditions further include the exposure parameters of the spectral acquisition device.
6. The method according to claim 1, characterized in that, Determining the water quality of the target water body based on the original reflectance of the target water body to obtain the water quality detection result of the target water body includes: Normalize the original reflectance of the target water body to obtain the normalized reflectance of the target water body. Among them, the normalized reflectance of each band of the target water body is positively correlated with the original reflectance of the target water body in this band, and negatively correlated with the original reflectance of other bands of the target water body; Determine the water quality of the target water body based on the normalized reflectance of the target water body to obtain the water quality detection result of the target water body.
7. A water quality detection device, characterized in that, The water quality detection device includes: a supplementary light, a spectral acquisition device, and a processor; The supplementary light is used to irradiate the target water body when it is turned on, so that the light emitted by the supplementary light is incident on the spectral acquisition device through the diffuse reflection of the target water body; The spectral acquisition device is used to acquire the active supplementary light water-leaving spectrum of the target water body when the supplementary light is turned on, and acquire the ambient light water-leaving spectrum of the target water body when the supplementary light is turned off; and send the active supplementary light water-leaving spectrum and the ambient light water-leaving spectrum to the processor; The processor is used to determine the spectrum of the light emitted by the supplementary light and incident on the spectral acquisition device through the diffuse reflection of the target water body according to the difference between the active supplementary light water-leaving spectrum and the ambient light water-leaving spectrum, and use it as the pure water-leaving spectrum; determine the original reflectance of the target water body to each band of light according to the pure water-leaving spectrum; determine the water quality of the target water body according to the original reflectance of the target water body to obtain the water quality detection result of the target water body.
8. The water quality detection device according to claim 7, characterized in that, The water quality detection device further includes a skylight acquisition device; The skylight acquisition device is used to acquire the light intensity of skylight; in response to the light intensity of skylight being lower than the preset lower light intensity threshold, send an on request to the supplementary light; And in response to the light intensity of skylight being higher than the preset upper light intensity threshold, send an off request to the supplementary light; The supplementary light is further used to turn on in response to the supplementary light request; and turn off in response to the off request.
9. The water quality detection device according to claim 7, characterized in that, A calibration file is pre-stored in the supplementary light, and the calibration file is used to represent the mapping relationship between the spectrum, the acquisition conditions, and the reflectance; The processor determines the original reflectance of the target water body to each band of light according to the pure water-leaving spectrum, including: Obtain the mapping relationship represented by the calibration file and obtain the acquisition conditions when acquiring the active supplementary light water-leaving spectrum and the ambient light water-leaving spectrum, and use them as the target acquisition conditions; Determine the reflectance corresponding to the pure water-leaving spectrum and the target acquisition conditions according to the pure water-leaving spectrum, the target acquisition conditions, and the mapping relationship, as the original reflectance of the target water body; Among them, the mapping relationship is obtained in advance through the following method: Obtain the respective reference spectra collected by the spectral acquisition device for each of the calibration components when the supplementary light source illuminates the calibration component assembly under different acquisition conditions; determine the mapping relationship between the spectrum, the acquisition conditions, and the reflectance according to the reflectance of the calibration component, each acquisition condition, and the reference spectra collected under each acquisition condition; wherein, the acquisition conditions include the illumination angle of the supplementary light source and / or the height of the supplementary light source relative to the calibration component.
10. The water quality detection device according to claim 7, characterized in that, The included angle between the optical axis of the supplementary light source and the central optical axis of the spectral acquisition device is less than a preset included angle threshold; The supplementary light source is a continuous light source, and the spectrum covers the 400-1000 nm band; The optical resolution of the spectral acquisition device is not greater than 2 nm, and the spectral range covers the 400-1000 nm band; The angle between the optical axis of the supplementary light source and the horizontal line of the target water body is between 20° and 70°.