Method, device and equipment for detecting abnormal pixels of spectrum water quality inversion image and medium
By pre-processing and abnormal cell judgment on the spectral images acquired in the spectral water quality monitoring of the drone, and identifying and processing abnormal cells in the water body image, the impact of abnormal water body imaging phenomena on water quality inversion is solved, and the accuracy and quality of water quality monitoring is improved.
Patent Information
- Application Number
- CN202411934647.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-25
AI Technical Summary
In the existing drone spectral water quality monitoring technology, the difference in the reflected signal of the water body at different wavelengths leads to insufficient reflectivity of the off-water body, which leads to abnormal water body imaging, affecting the accuracy of water quality inversion.
By acquiring the spectral image to be detected, pre-processing is performed to obtain the surface reflectivity image, extract the water body area, use the pre-established anomaly cell discrimination model to determine the abnormal cell, and identify and label or eliminate water body cells with unqualified spectral quality.
Effectively identify and process abnormal cells in water body images, improve the accuracy and quality of water quality inversion, and ensure the reliability of water quality monitoring results.
Smart Images

Figure CN119888464A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of surface water quality monitoring, and in particular to a method, device, equipment and medium for detecting abnormal pixels in a spectral water quality inversion image. Background Art
[0002] Water quality monitoring refers to the fixed-point, continuous or regular sampling and measurement of pollutants in water. The purpose of water quality monitoring is to timely, accurately and comprehensively reflect the current status and development trend of water quality, and provide a scientific basis for water quality management, pollution source control, water quality planning and water quality evaluation.
[0003] UAV remote sensing technology is widely used in the field of water quality monitoring due to its advantages such as flexible spectral payload, high spatial resolution, and convenience. Accurate water spectral data is the basis for UAV spectral water quality monitoring. Existing UAV spectral water quality monitoring technology uses visible light channels to collect water reflectance data, and inverts water quality by establishing a regression relationship between reflectance data and water quality data.
[0004] However, in addition to the strong reflection of water in the blue-green channel, its reflection signal decreases significantly with the increase of wavelength, and the reflectivity is close to 0 in the near-infrared band. This leads to the important optical parameter of water quality inversion - the off-water reflectivity is less than 10% in the visible light channel, which is much lower than other ground objects. Therefore, water body imaging anomalies are prone to occur in water quality inversion. In addition, due to the changes in the flight attitude of the drone and the influence of the external environment, the spectral quality of some water body images will be poor, which will affect the accuracy of water quality inversion. Therefore, it becomes a basic task of water quality inversion to find out some water bodies in the image that are abnormal and not suitable for water quality inversion, and then mark or eliminate these water areas during water quality inversion. Summary of the invention
[0005] In view of the above-mentioned problems in the prior art, the purpose of the present invention is to provide a method, device, equipment and medium for detecting abnormal pixels in spectral water quality inversion images, which can effectively identify some water bodies in spectral water quality inversion images that are abnormal and not suitable for water quality inversion, thereby assisting subsequent spectral water quality inversion and improving the quality of water quality inversion.
[0006] In order to solve the above problems, the present invention provides a method for detecting abnormal pixels in a spectral water quality inversion image, comprising:
[0007] Acquire a spectral image to be detected;
[0008] Preprocess the spectral image to obtain the corresponding surface reflectance image;
[0009] Extract water area from the surface reflectance image to obtain a water area reflectance image for water quality inversion;
[0010] Using the pre-established abnormal pixel discrimination model, the abnormal pixel discrimination is performed based on the reflectivity image of the water area to obtain the abnormal pixel detection result;
[0011] Among them, the abnormal pixel discrimination model is pre-constructed based on the reflectivity characteristics of the water body.
[0012] Furthermore, the spectral image is preprocessed to obtain the corresponding surface reflectance image, including:
[0013] Perform radiation calibration based on the spectral image to obtain the corresponding radiance image;
[0014] Obtain standard radiance data and sky light radiance data corresponding to the spectral image;
[0015] Based on the standard radiance data, skylight radiance data and radiance image, a surface reflectance image corresponding to the spectral image is generated.
[0016] Further, the spectral image is multiple;
[0017] Preprocess the spectral image to obtain the corresponding surface reflectance image, which also includes:
[0018] Perform image stitching on the surface reflectance images corresponding to the various spectral images to obtain a stitched surface reflectance image;
[0019] Among them, the water area is extracted from the surface reflectance image to obtain the water area reflectance image used for water quality inversion, including:
[0020] The water body area is extracted from the spliced surface reflectance image to obtain the water body area reflectance image used for water quality inversion.
[0021] Furthermore, water body regions are extracted from the surface reflectance image to obtain a water body region reflectance image for water quality inversion, including:
[0022] Constructing the normalized water index or normalized vegetation index based on the surface reflectance image;
[0023] Generate water body mask using normalized water index or normalized vegetation index;
[0024] The water body area reflectance image for water quality inversion is extracted from the surface reflectance image based on the water body mask.
[0025] Furthermore, using the pre-established abnormal pixel discrimination model, abnormal pixel discrimination is performed based on the water area reflectance image to obtain abnormal pixel detection results, including:
[0026] The water body area reflectance image is input into an abnormal pixel discrimination model, and the abnormal pixel discrimination model is used to judge whether the reflectance characteristics of the water body are abnormal pixel by pixel based on the water body area reflectance image, and generate and output abnormal pixel masks according to the abnormal pixels;
[0027] Obtaining the abnormal pixel mask output by the abnormal pixel discrimination model;
[0028] Each abnormal pixel in the spectral image is determined based on the abnormal pixel mask to obtain the abnormal pixel detection result.
[0029] Further, the abnormal pixel discrimination model includes one or more abnormal pixel discrimination modules among a first abnormal pixel discrimination module, a second abnormal pixel discrimination module and a third abnormal pixel discrimination module;
[0030] The first abnormal pixel discrimination module is used to determine whether the reflectivity characteristics of the water body have insufficient light, and generate an insufficient light mask according to the pixels with insufficient light;
[0031] The second abnormal pixel discrimination module is used to determine whether there is solar glare in the reflectivity characteristics of the water body, and to generate a solar glare mask based on the pixels with solar glare;
[0032] The third abnormal pixel discrimination module is used to determine whether there is image color cast in the reflectivity characteristics of the water body, and to generate an image color cast mask according to the pixels with image color cast.
[0033] Furthermore, the method further comprises:
[0034] Based on the abnormal pixel detection results, the abnormal pixels in the spectral image are marked or removed.
[0035] Another aspect of the present invention provides a device for detecting abnormal pixels in a spectral water quality inversion image, comprising:
[0036] An image acquisition module, used for acquiring a spectral image to be detected;
[0037] A preprocessing module is used to preprocess the spectral image to obtain the corresponding surface reflectance image;
[0038] A water body extraction module is used to extract water body areas from the surface reflectance image to obtain a water body area reflectance image for water quality inversion;
[0039] An abnormality detection module is used to use a pre-established abnormal pixel discrimination model to discriminate abnormal pixels based on the water area reflectivity image to obtain abnormal pixel detection results;
[0040] Among them, the abnormal pixel discrimination model is pre-constructed based on the reflectivity characteristics of the water body.
[0041] On the other hand, the present invention provides an electronic device, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the abnormal pixel detection method of the spectral water quality inversion image as mentioned above.
[0042] On the other hand, the present invention provides a computer-readable storage medium, which stores at least one instruction or at least one program. The at least one instruction or the at least one program is loaded and executed by a processor to implement the abnormal pixel detection method of the spectral water quality inversion image as mentioned above.
[0043] Another aspect of the present invention provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the above-mentioned method for detecting abnormal pixels in a spectral water quality inversion image.
[0044] Due to the above technical solution, the present invention has the following beneficial effects:
[0045] According to the abnormal pixel detection method of the spectral water quality inversion image in an embodiment of the present invention, an abnormal pixel discrimination model is constructed through the spectral characteristics of the water body in different channels, and water body pixels with unqualified spectral quality in the spectral water quality inversion image are identified based on the established abnormal pixel discrimination model, thereby assisting the subsequent spectral water quality inversion and improving the water quality inversion quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments or prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
[0047] Figure 1 It is a flow chart of a method for detecting abnormal pixels in a spectral water quality inversion image provided by an embodiment of the present invention;
[0048] Figure 2 is a flow chart of a method for detecting abnormal pixels in a spectral water quality inversion image provided by another embodiment of the present invention;
[0049] Figure 3 is a flow chart of a method for detecting abnormal pixels in a spectral water quality inversion image provided by another embodiment of the present invention;
[0050] Figure 4 is a flow chart of a method for detecting abnormal pixels in a spectral water quality inversion image provided by another embodiment of the present invention;
[0051] Figure 5It is a structural schematic diagram of an abnormal pixel detection device for a spectral water quality inversion image provided by an embodiment of the present invention;
[0052] Figure 6 is a block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0055] The abnormal pixel detection method of the spectral water quality inversion image provided by the embodiment of the present invention can be applied to the water body image quality judgment scene before water quality inversion in the spectral water quality monitoring technology of unmanned aerial vehicle. Since the water body has a strong reflection in the blue-green channel, its reflection signal decreases significantly with the increase of wavelength, and the reflectivity is close to 0 in the near-infrared band, which leads to the important optical parameter of water quality inversion-the off-water reflectivity in the visible light channel is less than 10%, which is much lower than other ground objects, so it is easy to have abnormal water body imaging in water quality inversion. In addition, due to the sun glare on the water surface caused by the change of the sun's altitude and the flight posture of the unmanned aerial vehicle, the shadows of the water surface buildings and trees caused by insufficient light, and the color cast of the image, the spectral quality of the corresponding part of the water body image is poor, which will interfere with the accuracy of water quality inversion. Therefore, it is necessary to analyze the spectral quality of the water body collected by the imaging spectrometer to determine whether it is suitable for water quality inversion. It is also possible to determine the spectral quality of each water body pixel in the image, and mark the pixels with unqualified spectral quality, so as to assist the later spectral water quality inversion, for example, to mark or eliminate these abnormal water body areas during water quality inversion.
[0056] Reference Manual Attached Figure 1, which shows the process of the abnormal pixel detection method of spectral water quality inversion image provided by an embodiment of the present invention. The method can be applied to various electronic devices such as servers, personal computers, laptops, smart phones, tablet computers and portable wearable devices. The server can be an independent server or a server cluster or distributed system composed of multiple servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. Specific examples are as follows: Figure 1 As shown, the method may include the following steps:
[0057] S110: Acquire a spectral image to be detected.
[0058] In an embodiment of the present invention, an imaging spectrometer may be used to collect a ground spectral image of the area to be monitored as the spectral image to be detected. For example, an imaging spectrometer may be mounted on a drone to collect a ground spectral image of the area to be monitored as the spectral image to be detected.
[0059] In the embodiment of the present invention, there may be one or more spectral images. When there are multiple spectral images, each spectral image may be a local image of the area to be monitored, and the overall image of the area to be monitored may be obtained by splicing the multiple spectral images.
[0060] In the embodiment of the present invention, the spectral image may include spectral data of multiple specific spectral channels, and the spectral data may include spectral values at multiple positions. At this time, a multi-channel imaging spectrometer mounted on an unmanned aerial vehicle may be used to collect ground spectral images. Among them, the specific spectral channel may be determined according to actual needs, and the embodiment of the present invention does not specifically limit this.
[0061] S120: Preprocess the spectral image to obtain a corresponding surface reflectance image.
[0062] In the embodiment of the present invention, the existing preprocessing method can be used to preprocess the acquired spectral image to generate a surface reflectance image, and the embodiment of the present invention does not impose any specific limitation on this.
[0063] In some embodiments, radiation calibration may be performed first according to the calibration coefficient of the imaging spectrometer that collects the spectral image, and then the surface reflectance image corresponding to the spectral image may be determined based on the obtained radiance image. Since the spectral image may include spectral data of multiple specific spectral channels, the obtained surface reflectance image may also include surface reflectance images of multiple specific spectral channels.
[0064] Specifically, in conjunction with the reference manual Figure 2 , preprocess the spectral image to obtain the corresponding surface reflectance image, which may include:
[0065] S121: Perform radiation calibration based on the spectral image to obtain a corresponding radiance image.
[0066] Specifically, for each spectral channel corresponding to the spectral image, radiation calibration can be performed according to the calibration coefficient of the imaging spectrometer. The calculation formula is as follows:
[0067]
[0068] Among them, L UAV (λ) represents the radiance of the spectral channel with a central wavelength of λ after calibration, DN represents the digital quantization value in the spectral image, and DN black represents the dark background response value, a o represents the radiation response coefficient, N represents the non-uniformity correction coefficient, t represents the integration time, g represents the gain, c1 and c2 represent the proportional coefficients related to the integration time and gain, and DN black , a o , N, t, g, c1, c2 are all calibration coefficients of the imaging spectrometer.
[0069] S122: Obtain standard radiance data and skylight radiance data corresponding to the spectral image.
[0070] Specifically, after using the drone to mount an imaging spectrometer to collect ground spectral images, the imaging spectrometer can also be used to collect the radiance data of the standard calibration gray plate, and the downlink light sensor can be mounted to collect light intensity data in real time and record position information. The radiance data of the standard calibration gray plate can include the standard radiance of multiple positions of multiple specific spectral channels, and the light intensity data can include the radiance of sky light at multiple positions.
[0071] S123: Generate a surface reflectance image corresponding to the spectral image based on the standard radiance data, the skylight radiance data and the radiance image.
[0072] Specifically, the corresponding relationship between the surface reflectance and radiance of the spectral channel with a central wavelength of λ on a standard calibration gray plate can be established according to the standard radiance and reflectance of the spectral channel, and the radiance of the sky light measured in real time can be corrected to obtain the following calculation formula:
[0073]
[0074] Where λ is the central wavelength of the spectral channel, R UAV (λ) represents the surface reflectance of the spectral channel with a central wavelength of λ, LUAV (λ) represents the radiance of the spectral channel with a central wavelength of λ, L sky (λ) represents the sky light radiance, L ref (λ) represents the standard radiance of the spectral channel with the central wavelength λ on the standard calibration gray plate, R ref (λ) represents the reflectivity of the standard calibration gray plate, r represents the Fresnel reflectivity, which is approximately 0.023, and π represents pi.
[0075] Specifically, using the above calculation formula (2), according to the radiance image and the standard radiance and skylight radiance corresponding to each spectral channel, the surface reflectance image corresponding to the spectral image can be calculated.
[0076] In some embodiments, the calculated surface reflectance image may be geometrically corrected to generate a surface reflectance orthoimage as the surface reflectance image corresponding to the spectral image. The specific implementation process of the geometric correction may refer to the prior art, and the embodiments of the present invention will not be described in detail here.
[0077] In some embodiments, when there are multiple spectral images, preprocessing the spectral images to obtain corresponding surface reflectance images may also include: stitching the surface reflectance images corresponding to the various spectral images to obtain a stitched surface reflectance image.
[0078] Specifically, when there are multiple spectral images, the surface reflectance images (or geometrically corrected surface reflectance orthophotos) corresponding to the multiple spectral images can be spliced to obtain the surface reflectance image of the entire monitored area. The specific implementation process of image splicing can refer to the prior art, and the embodiments of the present invention will not be described in detail here.
[0079] It can be understood that the embodiment of the present invention obtains the surface reflectance image of the entire monitored area through image stitching to perform abnormal pixel detection, which can improve the detection efficiency of abnormal pixels.
[0080] S130: Extracting water areas from the surface reflectance image to obtain a water area reflectance image for water quality inversion.
[0081] In the embodiment of the present invention, the existing water body region extraction method can be used to extract the water body region in the surface reflectance image, and the embodiment of the present invention does not impose any specific limitation on this.
[0082] In some embodiments, a normalized water index or a normalized vegetation index may be constructed by using the spectral feature differences in the surface reflectance image, and then a water mask may be generated, which is then used to crop the surface reflectance image to obtain the water area in the image.
[0083] Specifically, in conjunction with the reference manual Figure 3 , extracting water area from the surface reflectance image to obtain a water area reflectance image for water quality inversion, which may include:
[0084] S131: constructing a normalized water index or a normalized vegetation index based on the surface reflectance image.
[0085] Alternatively, the normalized water index NDWI can be constructed by using the reflectance characteristic difference between the green channel and the near-infrared channel in the surface reflectance image. The formula is as follows:
[0086] NDWI=(R green -R NIR ) / (R green +R NIR ) (3)
[0087] Among them, R green Represents the surface reflectance of the green channel, R NIR Represents the surface reflectance of the near-infrared channel.
[0088] Alternatively, the normalized vegetation index NDVI can be constructed by using the reflectance characteristic difference between the red channel and the near-infrared channel in the surface reflectance image. The formula is as follows:
[0089] NDVI=(R NIR -R red ) / (R NIR +R red ) (4)
[0090] Among them, R NIR represents the surface reflectance of the near-infrared channel, R green Represents the surface reflectance of the red channel.
[0091] S132: Generate a water body mask using the normalized water index or the normalized vegetation index.
[0092] Specifically, the existing mask generation method may be used to generate a water body mask using the constructed normalized water body index or normalized vegetation index, which will not be described in detail in the embodiment of the present invention.
[0093] S133: Extracting a water body area reflectance image for water quality inversion from the surface reflectance image based on the water body mask.
[0094] Specifically, the generated water body mask can be used to crop the surface reflectance image to obtain the water body area in the image.
[0095] It should be noted that the above-mentioned implementation of generating a water body mask by normalized water index or normalized vegetation index is only an example. In actual applications, a water body mask can also be generated by the reflectivity characteristic differences between other channels. The embodiment of the present invention does not impose specific limitations on this.
[0096] In some embodiments, when there are multiple spectral images, performing water area extraction on the surface reflectance image to obtain a water area reflectance image for water quality inversion may include: performing water area extraction on the spliced surface reflectance image to obtain a water area reflectance image for water quality inversion. For specific water area extraction methods, please refer to Figure 3 The relevant contents in the illustrated embodiment will not be described in detail in the embodiment of the present invention.
[0097] It can be understood that the embodiment of the present invention can improve the accuracy of water body extraction by generating a water body mask based on the normalized water body index or the normalized vegetation index to perform water body extraction.
[0098] S140: Using a pre-established abnormal pixel discrimination model, abnormal pixel discrimination is performed based on the water body area reflectivity image to obtain an abnormal pixel detection result.
[0099] In an embodiment of the present invention, an abnormal pixel discrimination model can be pre-constructed based on the reflectivity characteristics of the water body to identify water body spectral quality problems such as insufficient illumination, solar glare and / or image color cast in the water body image. When performing abnormal pixel detection, the abnormal pixel discrimination model can be directly applied to perform abnormal pixel discrimination to obtain abnormal pixel detection results. Among them, the abnormal pixel detection results can include each abnormal pixel with spectral quality problems in the spectral image.
[0100] In practical applications, the structure of the abnormal pixel discrimination model can be set according to actual needs, for example, the abnormal pixel discrimination model can be set to a decision tree model, etc., and the embodiment of the present invention does not specifically limit this. The construction method of the abnormal pixel discrimination model can refer to the existing model construction method, and the embodiment of the present invention will not be repeated here.
[0101] In some embodiments, the Figure 4 , using the pre-established abnormal pixel discrimination model, abnormal pixel discrimination is performed based on the water area reflectance image to obtain abnormal pixel detection results, which may include:
[0102] S141: Inputting the water body area reflectance image into the abnormal pixel discrimination model, the abnormal pixel discrimination model is used to judge whether there is any abnormality in the reflectance characteristics of the water body pixel by pixel based on the water body area reflectance image, and generate and output abnormal pixel masks based on the pixels with abnormalities.
[0103] S142: Obtain the abnormal pixel mask output by the abnormal pixel discrimination model.
[0104] In an embodiment of the present invention, the abnormal pixel discrimination model may include one or more abnormal pixel discrimination modules among a first abnormal pixel discrimination module, a second abnormal pixel discrimination module and a third abnormal pixel discrimination module, and different abnormal pixel discrimination modules can be used to judge different types of water body spectral quality abnormalities.
[0105] Specifically, the first abnormal pixel discrimination module can be used to determine whether there is insufficient light in the reflectivity characteristics of the water body, and generate an insufficient light mask based on the pixels with insufficient light; the second abnormal pixel discrimination module can be used to determine whether there is solar glare in the reflectivity characteristics of the water body, and generate a solar glare mask based on the pixels with solar glare; the third abnormal pixel discrimination module can be used to determine whether there is image color cast in the reflectivity characteristics of the water body, and generate an image color cast mask based on the pixels with image color cast.
[0106] Specifically, the obtained water area reflectance image can be directly input into the abnormal pixel discrimination model. The first abnormal pixel discrimination module in the abnormal pixel discrimination model can use the characteristic that the green channel reflectance of normal water bodies is significantly higher than the near-infrared channel reflectance to judge the reflectance characteristics of water bodies pixel by pixel. green <R NIR ), the pixel is marked as insufficiently illuminated, and an insufficiently illuminated mask is generated. The second abnormal pixel discrimination module in the abnormal pixel discrimination model can use the characteristic that the red channel reflectance of normal water bodies is higher than the near-infrared channel reflectance to judge the reflectance characteristics of water bodies pixel by pixel. When the reflectance of the pixel in the near-infrared channel is abnormally high and higher than the red channel reflectance (i.e., R red <R NIR ), the pixel is marked as having solar glare, and a solar glare mask is generated. The third abnormal pixel discrimination module in the abnormal pixel discrimination model can use the characteristic that the spectral curve of a normal water body reaches the reflectance peak in the green channel to judge the reflectance characteristics of the water body pixel by pixel. When the reflectance of the pixel in the blue channel or the red channel is greater than that of the green channel (i.e., R blue >R green or R red >R green ), the pixel is marked as having image color cast, and an image color cast mask is generated. The abnormal pixel discrimination model can output the masks generated by each abnormal pixel discrimination module after superposition, that is, the output includes one or more abnormal pixel masks of abnormal water body spectral quality.
[0107] It should be noted that the above-mentioned embodiments of judging whether there is insufficient illumination by the reflectivity characteristics between the green channel and the near-infrared channel, judging whether there is solar glare by the reflectivity characteristics between the near-infrared channel and the red channel, and judging whether there is image color cast by the reflectivity characteristics between the blue channel, the red channel and the green channel are only examples. In practical applications, other adjacent channels with central wavelengths close to the blue channel, the green channel, the red channel, and the near-infrared channel can also be used to replace the channels used in the abnormal pixel discrimination model in the embodiment of the present invention, and the embodiment of the present invention does not specifically limit this.
[0108] It should be noted that the above-mentioned implementation methods of judging the existence of abnormalities such as insufficient lighting, solar glare and image color cast in pixels are only examples. In actual applications, only some types of abnormalities may be judged, or other types of abnormalities may be judged, and the embodiments of the present invention do not impose specific limitations on this.
[0109] It can be understood that in the embodiment of the present invention, the reflectivity characteristics of the blue channel, the green channel, the red channel, and the near-infrared channel are used to determine whether there is abnormality in the spectral quality of the water body, which has better versatility.
[0110] S143: Determine each abnormal pixel in the spectral image based on the abnormal pixel mask to obtain an abnormal pixel detection result.
[0111] In the embodiment of the present invention, the abnormal pixel mask and the spectral image may be superimposed to obtain the abnormal pixel detection result corresponding to the spectral image.
[0112] It can be understood that in the embodiment of the present invention, the abnormal pixel discrimination model is used to utilize the spectral characteristics of the water body in different channels to perform pixel-by-pixel abnormality discrimination on the reflectance image of the water body area, which can effectively identify water body imaging problems such as solar glare on the water surface, insufficient light, and image color cast in the image, and generate corresponding water body imaging abnormal pixel mask files to assist in subsequent water quality inversion.
[0113] In some embodiments, the method may further include: marking or removing abnormal pixels in the spectral image based on the abnormal pixel detection result.
[0114] Specifically, before using spectral images for water quality inversion, detected abnormal pixels can also be marked or removed, thereby marking or removing parts of the water body in the image that are abnormal and not suitable for water quality inversion, thereby improving the accuracy of spectral water quality monitoring.
[0115] It can be understood that in the embodiment of the present invention, by first judging the spectral quality of the water body before water quality inversion, masking the abnormal pixel areas of the water body imaging, and marking or eliminating these abnormal water body pixel areas during water quality inversion, the water quality inversion quality can be improved.
[0116] In summary, according to the abnormal pixel detection method of the spectral water quality inversion image according to the embodiment of the present invention, an abnormal pixel discrimination model is constructed through the spectral characteristics of the water body in different channels, and water body pixels with unqualified spectral quality in the spectral water quality inversion image are identified based on the established abnormal pixel discrimination model, thereby assisting the subsequent spectral water quality inversion and improving the water quality inversion quality.
[0117] Reference Manual Attached Figure 5 , which shows the structure of a spectral water quality inversion image abnormal pixel detection device 500 provided by an embodiment of the present invention. Figure 5 As shown, the apparatus 500 may include:
[0118] An image acquisition module 510 is used to acquire a spectral image to be detected;
[0119] A preprocessing module 520 is used to preprocess the spectral image to obtain a corresponding surface reflectance image;
[0120] A water body extraction module 530 is used to extract water body regions from the surface reflectance image to obtain a water body region reflectance image for water quality inversion;
[0121] The abnormality detection module 540 is used to use a pre-established abnormal pixel discrimination model to discriminate abnormal pixels based on the water body area reflectivity image to obtain abnormal pixel detection results;
[0122] Among them, the abnormal pixel discrimination model is pre-constructed based on the reflectivity characteristics of the water body.
[0123] It should be noted that the device provided in the above embodiment, when implementing its functions, only uses the division of the above functional modules as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device provided in the above embodiment and the corresponding method embodiment belong to the same concept, and the specific implementation process is detailed in the corresponding method embodiment, which will not be repeated here.
[0124] An embodiment of the present invention also provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the abnormal pixel detection method of the spectral water quality inversion image provided in the above method embodiment.
[0125] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.
[0126] In conjunction with the reference manual Figure 6 , which is a block diagram of an electronic device 600 according to an embodiment of the present invention. The electronic device 600 may include one or more processors 602, a system control logic 608 connected to at least one of the processors 602, a system memory 604 connected to the system control logic 608, a non-volatile memory (NVM) 606 connected to the system control logic 608, and a network interface 610 connected to the system control logic 608.
[0127] The processor 602 may include one or more single-core or multi-core processors. The processor 602 may include any combination of general-purpose processors and special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In the embodiments of the present invention, the processor 602 may be configured to execute the following operations: Figures 1 to 4 One or more of the various embodiments shown.
[0128] In some embodiments, system control logic 608 may include any suitable interface controller to provide any suitable interface to at least one of processors 602 and / or any suitable device or component in communication with system control logic 608 .
[0129] In some embodiments, the system control logic 608 may include one or more memory controllers to provide an interface to the system memory 604. The system memory 604 may be used to load and store data and / or instructions. In some embodiments, the memory 604 of the device 600 may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).
[0130] NVM / memory 606 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some embodiments, NVM / memory 606 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as at least one of a HDD (Hard Disk Drive), a CD (Compact Disc) drive, and a DVD (Digital Versatile Disc) drive.
[0131] NVM / storage 606 may include a portion of storage resources installed on a device of apparatus 600, or it may be accessible to the apparatus but not necessarily a part of the apparatus. For example, NVM / storage 606 may be accessed over a network via network interface 610.
[0132] In particular, system memory 604 and NVM / storage 606 may include, respectively, a temporary copy and a permanent copy of instructions 620. Instructions 620 may include instructions that, when executed by at least one of processors 602, cause device 600 to perform the following operations: Figures 1 to 4 Instructions of the abnormal pixel detection method of the spectral water quality inversion image shown. In some embodiments, the instructions 620, hardware, firmware and / or software components thereof may be additionally / alternatively placed in the system control logic 608, the network interface 610 and / or the processor 602.
[0133] The network interface 610 may include a transceiver for providing a radio interface for the device 600 to communicate with any other suitable device (such as a front-end module, an antenna, etc.) through one or more networks. In some embodiments, the network interface 610 may be integrated with other components of the device 600. For example, the network interface 610 may be integrated with at least one of a communication module of the processor 602, a system memory 604, an NVM / storage 606, and a firmware device (not shown) having instructions. When at least one of the processors 602 executes the instructions, the device 600 implements Figures 1 to 4 One or more of the various embodiments shown.
[0134] The network interface 610 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 610 may be a network adapter, a wireless network adapter, a telephone modem and / or a wireless modem.
[0135] In one embodiment, at least one of the processors 602 may be packaged together with logic for one or more controllers of the system control logic 608 to form a system in package (SiP). In one embodiment, at least one of the processors 602 may be integrated on the same die with logic for one or more controllers of the system control logic 608 to form a system on chip (SoC).
[0136] The device 600 may further include an input / output (I / O) device 612. The I / O device 612 may include a user interface to enable a user to interact with the device 600; the design of the peripheral component interface enables the peripheral components to interact with the device 600. In some embodiments, the device 600 further includes a sensor for determining at least one of an environmental condition and location information related to the device 600.
[0137] In some embodiments, the user interface may include, but is not limited to, a display (e.g., an LCD display, a touch screen display, etc.), a speaker, a microphone, one or more cameras (e.g., a still image camera and / or a video camera), a flashlight (e.g., an LED flash), and a keyboard.
[0138] In some embodiments, the peripheral component interface may include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.
[0139] In some embodiments, the sensors may include, but are not limited to, gyroscope sensors, accelerometers, proximity sensors, ambient light sensors, and positioning units. The positioning unit may also be part of or interact with the network interface 610 to communicate with components of a positioning network (e.g., global positioning system (GPS) satellites).
[0140] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 600. In other embodiments of the present invention, the electronic device 600 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0141] An embodiment of the present invention also provides a computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to implementing a method for detecting abnormal pixels in a spectral water quality inversion image. The at least one instruction or the at least one program is loaded and executed by the processor to implement the method for detecting abnormal pixels in a spectral water quality inversion image provided in the above method embodiment.
[0142] Optionally, in an embodiment of the present invention, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0143] An embodiment of the present invention further provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the abnormal pixel detection method of the spectral water quality inversion image provided in the above various optional implementation examples.
[0144] It should be noted that the sequence of the embodiments of the present invention described above is for description only and does not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0145] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0146] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0147] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting abnormal pixels in spectral water quality inversion images, characterized in that: The method comprises: Acquire a spectral image to be detected; Preprocessing the spectral image to obtain a corresponding surface reflectance image; Extracting water areas from the surface reflectance image to obtain a water area reflectance image for water quality inversion; Using a pre-established abnormal pixel discrimination model, abnormal pixel discrimination is performed based on the reflectivity image of the water body area to obtain an abnormal pixel detection result; Wherein, the abnormal pixel discrimination model is pre-constructed based on the reflectivity characteristics of the water body.
2. The method according to claim 1, characterized in that The preprocessing of the spectral image to obtain a corresponding surface reflectance image includes: Performing radiation calibration based on the spectral image to obtain a corresponding radiance image; Obtaining standard radiance data and sky light radiance data corresponding to the spectral image; A surface reflectance image corresponding to the spectral image is generated based on the standard radiance data, the skylight radiance data and the radiance image.
3. The method according to claim 2, characterized in that The spectral images are multiple; The preprocessing of the spectral image to obtain a corresponding surface reflectance image also includes: Performing image stitching on the surface reflectance images corresponding to the spectral images to obtain a stitched surface reflectance image; The step of extracting the water area from the surface reflectance image to obtain the water area reflectance image for water quality inversion includes: The water body region is extracted from the spliced surface reflectance image to obtain a water body region reflectance image for water quality inversion.
4. The method according to claim 1, characterized in that: The step of extracting the water area from the surface reflectance image to obtain the water area reflectance image for water quality inversion includes: Constructing a normalized water index or a normalized vegetation index based on the surface reflectance image; Generate a water body mask using the normalized water body index or the normalized vegetation index; The water body area reflectance image for water quality inversion is extracted from the surface reflectance image based on the water body mask.
5. The method according to claim 1, characterized in that The abnormal pixel discrimination model established in advance is used to discriminate abnormal pixels based on the water body area reflectivity image to obtain abnormal pixel detection results, including: The water body area reflectance image is input into the abnormal pixel discrimination model, and the abnormal pixel discrimination model is used to judge whether the reflectance characteristics of the water body are abnormal pixel by pixel based on the water body area reflectance image, and generate and output abnormal pixel masks according to the abnormal pixels; Obtaining an abnormal pixel mask output by the abnormal pixel discrimination model; Each abnormal pixel in the spectral image is determined based on the abnormal pixel mask to obtain an abnormal pixel detection result.
6. The method according to claim 5, characterized in that The abnormal pixel discrimination model includes one or more abnormal pixel discrimination modules among a first abnormal pixel discrimination module, a second abnormal pixel discrimination module and a third abnormal pixel discrimination module; The first abnormal pixel discrimination module is used to determine whether the reflectivity characteristics of the water body have insufficient illumination, and to generate insufficient illumination masks according to the pixels with insufficient illumination; The second abnormal pixel discrimination module is used to determine whether there is solar glare in the reflectivity characteristics of the water body, and to generate a solar glare mask based on the pixels with solar glare; The third abnormal pixel discrimination module is used to determine whether there is image color cast in the reflectivity characteristics of the water body, and to generate an image color cast mask according to the pixels with image color cast.
7. The method according to claim 1, characterized in that The method further comprises: Based on the abnormal pixel detection result, the abnormal pixels in the spectral image are marked or removed.
8. A device for detecting abnormal pixels in spectral water quality inversion images, characterized in that: include: An image acquisition module, used for acquiring a spectral image to be detected; A preprocessing module, used for preprocessing the spectral image to obtain a corresponding surface reflectance image; A water body extraction module, used for extracting water body regions from the surface reflectance image to obtain a water body region reflectance image for water quality inversion; An abnormality detection module, used to use a pre-established abnormal pixel discrimination model to discriminate abnormal pixels based on the reflectivity image of the water body area to obtain abnormal pixel detection results; Wherein, the abnormal pixel discrimination model is pre-constructed based on the reflectivity characteristics of the water body.
9. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the abnormal pixel detection method of the spectral water quality inversion image as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the abnormal pixel detection method of the spectral water quality inversion image as described in any one of claims 1-7.