A method for correcting unmanned aerial vehicle water body spectral image
By combining feature point matching and registration offset parameter calculation with surface reflectance correction and hyperspectral masking, the problems of pixel misalignment and reflectance error in UAV multispectral images were solved, achieving efficient and automated image correction and water quality parameter inversion.
Patent Information
- Application Number
- CN202611656191.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-26
- Publication Date
- 2026-11-24
AI Technical Summary
In existing technologies, multiple images acquired by UAV multispectral cameras at the same aerial shooting time have pixel misalignment, resulting in low efficiency of manual registration and large errors in reflectivity calculation. Furthermore, it is impossible to automatically read the positioning information and flight angle from the image metadata.
Pixel-level alignment of multispectral images is achieved through feature point matching and registration offset parameter calculation. Combined with surface reflectance calculation, anomalous pixel cropping, geographic rotation, and cropping edge trimming, the correction process is completed automatically. A specular mask is constructed using the visible light band to remove water surface highlights.
It achieves efficient and automated image registration, improves the accuracy of reflectance calculation, generates geographic images in the due north direction, eliminates the influence of sensor noise, and improves the accuracy of water quality parameter inversion.
Smart Images

Figure CN123160403A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of UAV remote sensing image processing technology, and in particular to a method for correcting UAV water spectral images. Background Technology
[0002] Unmanned aerial vehicles (UAVs) equipped with multispectral cameras for remote sensing monitoring of river water bodies have become an important means of water environment monitoring and quantitative water quality inversion. Multispectral cameras typically acquire images of multiple spectral bands at the same time of aerial photography. Each band of image records the reflectance information of water bodies and ground objects at different wavelengths, providing a data foundation for the quantitative inversion of water quality parameters such as chlorophyll, suspended solids, and turbidity.
[0003] However, multiple images acquired by a multispectral camera at the same aerial moment may have pixel misalignment and cannot be perfectly aligned. Existing technologies typically rely on manual registration, but manual registration is inefficient. Summary of the Invention
[0004] In view of this, this application provides a method for correcting UAV water spectral images, which achieves pixel-level alignment of multispectral images through feature point matching and registration offset parameter calculation, thus solving the problem of low efficiency of manual registration in the prior art.
[0005] The present application is described below from multiple aspects, and the implementation methods of these aspects can be referred to each other.
[0006] In a first aspect, this application provides a method for correcting spectral images of water bodies using unmanned aerial vehicles (UAVs), comprising: acquiring multispectral images of a target water body, wherein the multispectral images include initial images of multiple initial bands;
[0007] An initial image of one band is determined from the initial images of the multiple initial bands as a reference image, and the pixel offset of other images relative to the reference image is calculated by feature point matching to obtain the registration offset parameters. The other images are initial images other than the reference image.
[0008] The dark offset value of each initial image is determined, and the surface reflectance of each pixel of the initial image is obtained based on the reference brightness value of each initial band and the dark offset value. The pixels corresponding to the surface reflectance that meet the abnormal conditions are cropped to obtain candidate images.
[0009] The candidate images are registered based on the registration offset parameters to obtain a registered image cube; and the registered image cube is geographically rotated based on the positioning information and yaw angle in the metadata of the multispectral images to obtain a reflectance image cube.
[0010] The reflectance image cube is adaptively cropped, and a high-brightness mask is constructed using the surface reflectance in the visible light band to remove highlights on the water surface, resulting in a corrected water spectral image.
[0011] In one possible implementation of the first aspect described above, the multispectral image includes an initial image of six initial bands, the center wavelengths of which are 450 nm, 530 nm, 570 nm, 650 nm, 680 nm and 720 nm, respectively.
[0012] In one possible implementation of the first aspect described above, the center wavelength of the reference band of the reference image is 680 nanometers.
[0013] In one possible implementation of the first aspect above, the registration offset parameters are obtained by calculating the pixel offsets of other images relative to the reference image through feature point matching, including:
[0014] Feature points of the reference image and feature points of the other images are extracted respectively, and feature point matching is performed.
[0015] Calculate the horizontal and vertical offsets of each candidate point in the other images, where the candidate points are the successfully matched feature points;
[0016] Use the median of all the horizontal offsets as the target horizontal offset;
[0017] The median of all the vertical offsets is taken as the target vertical offset.
[0018] The target horizontal offset and the target vertical offset are used as the registration offset parameters for the initial bands corresponding to the other images.
[0019] In one possible implementation of the first aspect above, the surface reflectance of each pixel in the initial image is obtained based on the reference brightness value of each initial band and the dark offset value of each image, including:
[0020] Obtain standard photographs taken with a standard gray card for each initial band;
[0021] Extract the standard brightness value of the target area from the standard image, and perform statistical calculations on the standard brightness value to obtain the reference brightness value of the initial band;
[0022] Calculate the dark offset value of the initial image;
[0023] For each pixel in the initial image, the surface reflectance of the pixel is obtained based on the pixel's current brightness value, reference brightness value, and dark offset value.
[0024] In one possible implementation of the first aspect described above, the surface reflectance of a pixel is equal to the standard reflectance of the initial band multiplied by a reflectance factor, the reflectance factor is equal to the quotient of a first difference divided by a second difference, the first difference is equal to the difference between the current brightness value and the dark offset value, and the second difference is equal to the difference between the reference brightness value and the dark offset value.
[0025] In one possible implementation of the first aspect above, the reflectance image cube is adaptively cropped, and a specular mask is constructed using the surface reflectance in the visible light band to remove water surface highlights, resulting in a corrected water spectral image, including:
[0026] Traverse the four sides of the reflectivity image cube and identify the clipping edges. The clipping edges are the edges in the Z direction where all values are 0; where the Z direction is the band direction in the reflectivity image cube.
[0027] By setting the upper limit of the number of pixels to be clipped, the clipping edges of the reflectivity image cube are clipped to obtain the clipped three-dimensional cube.
[0028] A hyperphoton mask is constructed using the surface reflectance of the cropped 3D cube and the corresponding image in the visible light band.
[0029] The pixels belonging to the highlight area in the highlight mask are filled with invalid values to obtain the corrected water spectral image.
[0030] Secondly, this application provides an electronic device, which includes a processor and a memory. The memory stores at least one instruction or at least one program, and the processor loads and executes the at least one instruction or at least one program to implement the UAV water spectral image correction method as described above.
[0031] Thirdly, this application provides a computer-readable storage medium storing at least one instruction or at least one program, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement the UAV water spectral image correction method as described above.
[0032] Fourthly, this application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the UAV water spectral image correction method as described above. Attached Figure Description
[0033] Figure 1 A flowchart of the UAV water spectral image correction method provided in the embodiments of this application;
[0034] Figure 2A flowchart for obtaining registration offset parameters by calculating the pixel offset of other images relative to the reference image through feature point matching, provided for embodiments of this application;
[0035] Figure 3 A flowchart for obtaining the surface reflectance of each pixel in the initial image, provided for embodiments of this application;
[0036] Figure 4 The flowchart illustrates how to adaptively crop a reflectance image cube and construct a high-brightness mask using the surface reflectance in the visible light band to remove water surface highlights, thus obtaining a corrected water body spectral image, as provided in this application embodiment.
[0037] Figure 5 This is a flowchart illustrating the overall implementation of the method provided in the embodiments of this application.
[0038] Figure 6 A block diagram of an electronic device provided in an embodiment of this application;
[0039] Figure 7 This is a block diagram of a SoC (system on chip) provided in an embodiment of this application. Detailed Implementation
[0040] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0041] The technical problems to be solved by the embodiments of this application will be described below.
[0042] As described in the background technology section above, multiple images acquired by a multispectral camera at the same aerial shooting time may have pixel misalignment. Existing technologies usually rely on manual registration, but manual registration is inefficient.
[0043] Furthermore, the accuracy of radiometric correction for multispectral imagery directly affects the reflectance calculation results. Existing processing methods often lack a unified deduction of sensor dark current noise and fail to perform independent calibration for each band using a standard reflectance reference board, resulting in significant errors in the reflectance calculation results. Additionally, aerial images exhibit a yaw angle during capture, and existing processing methods cannot automatically read the positioning information and yaw angle from the image metadata to generate a true north-oriented geographic image.
[0044] Therefore, to address the aforementioned issues, this application provides a method for correcting UAV water spectral images. This method achieves pixel-level alignment of multispectral images through feature point matching and registration offset parameter calculation. Based on surface reflectance calculation, outlier pixel cropping, geographic rotation, and cropping edge trimming, a registered reflectance image cube is obtained. Then, a specular mask is constructed using the visible light band to remove water surface highlights, resulting in the corrected water spectral image. This method automates the entire correction process, solving the technical problems of low efficiency in manual registration, large errors in reflectance calculation results, and the inability to automatically read positioning information and flight angle from image metadata to generate a true north geographic image in existing technologies.
[0045] To better understand the UAV water spectral image correction method according to the embodiments of this application, the following description is provided in conjunction with the appendix to the specification. Figures 1-5 The specific scheme corresponding to the UAV water spectral image correction method of the embodiments of this application will be described in detail.
[0046] Reference Figure 1 , Figure 1 This is a flowchart of the UAV water spectral image correction method according to an embodiment of this application.
[0047] like Figure 1 As shown in the embodiments of this application, the UAV water spectral image correction method may include S100 to S500.
[0048] S100 involves acquiring multispectral images of the target water body, which include initial images of multiple initial bands.
[0049] Specifically, a drone is used to acquire multispectral images of the target water body. These multispectral images can include initial images in six initial bands, with center wavelengths of 450 nm, 530 nm, 570 nm, 650 nm, 680 nm, and 720 nm, respectively. In one embodiment of this application, the drone's multispectral camera integrates six independent imaging sensors. Each sensor is equipped with a narrowband filter with center wavelengths of 450 nm (blue light), 530 nm (green light), 570 nm (yellow light), 650 nm (red light), 680 nm (red edge), and 720 nm (near-infrared). Each time the drone triggers the shutter, the six sensors are simultaneously exposed, acquiring six initial images at the same time.
[0050] It should be noted that in other embodiments, multispectral images may include initial images of more or fewer bands, such as 5, 8, 10, etc., and this application is not limited to this.
[0051] The metadata of the initial imagery, embedded in the exchangeable image file format (EXIF) or the extensible metadata platform (XMP), contains attitude information such as GPS coordinates, downwelling light sensor (DLS) yaw, pitch, and roll angles, as well as acquisition parameters such as image exposure time, recorded by the UAV flight control system. This information is used for subsequent geometric correction and geocoding. The GPS coordinates are in the WGS84 coordinate system (world geoodetic system 1984).
[0052] Preferably, the center wavelength of the reference band is 680 nm, and the reference band is the initial band used for the reference image. The six independent imaging sensors in the six-band multispectral camera are arranged linearly or in an array in terms of hardware layout, with the 680 nm band sensor physically located close to the geometric center of the entire sensor array. Choosing this position as the reference ensures that the absolute values of the registration offset parameters of the other five bands (450 nm, 530 nm, 570 nm, 650 nm, 720 nm) are relatively small and evenly distributed during the registration process, avoiding excessive offset in the other bands caused by selecting edge bands (such as 450 nm or 720 nm) as the reference.
[0053] S200: From the initial images of multiple initial bands, an initial image of one band is determined as the reference image. The pixel offset of other images relative to the reference image is calculated by feature point matching to obtain the registration offset parameters. The other images are the initial images other than the reference image.
[0054] Specifically, for several multispectral images generated by aerial photography of large-area rivers, each multispectral image is processed using S200-S500 to obtain a corrected water spectral image.
[0055] In this application, multiple multispectral images are distributed to multiple processing processes or computing units, and the processing of the multispectral images is independent and undependent. Through batch parallel processing, the overall processing time of large-scale river aerial photography data is significantly shortened, and the processing throughput is improved.
[0056] Specifically, the Oriented FAST and Rotated BRIEF (ORB) algorithm is used to calculate the pixel offset of other images relative to the reference image through feature point matching, thus obtaining the registration offset parameters. The ORB algorithm uses the corner detector of the Features from Accelerated Segment Test (FAST) algorithm to extract feature points from both the other and reference images. The ORB algorithm uses Rotation-Aware Binary Robust Independent Elementary Features (rBRIEF) to convert each feature point into a binary string. Hamming distance is used to measure the similarity between the binary strings of two feature descriptors. A smaller distance indicates greater similarity between the two feature points. The correct matching point pairs between the feature points of the other images and the reference image are obtained through similarity analysis.
[0057] By correctly matching point pairs, the offsets of feature points in other images relative to the reference image are obtained. These offsets include horizontal and vertical offsets. The registration offset parameters are obtained by taking the median of the horizontal and vertical offsets of the correctly matched point pairs. It can be understood that in a multispectral image, the intermediate bands correspond to the registration offset parameters. The intermediate bands are the initial bands other than the reference bands.
[0058] S300, determine the dark offset value of each initial image, and based on the reference brightness value and dark offset value of each initial band, obtain the surface reflectance of each pixel of the initial image, and crop the pixels corresponding to the surface reflectance that meet the anomalous conditions to obtain candidate images.
[0059] Specifically, before calculating the surface reflectance, the current brightness value of each initial image is normalized to 0~1 according to the bit depth full scale; wherein, the full scale of the 8-bit integer image is 255, the full scale of the 16-bit integer image is 65535, and the full scale of the floating-point image is inferred to be 1, 255 or 65535 based on its numerical range.
[0060] Wherein, the surface reflectance of a pixel is equal to the standard reflectance of the initial band multiplied by the reflectance factor, the reflectance factor is equal to the quotient of the first difference divided by the second difference, the first difference is equal to the difference between the normalized current brightness value and the normalized dark offset value, and the second difference is equal to the difference between the normalized reference brightness value and the normalized dark offset value.
[0061] Specifically, the reference brightness value is the average brightness reading of the gray card in the initial band, used as a reference for the current brightness value of the pixel.
[0062] Specifically, dark offset is the inherent electronic noise generated by the sensor under completely dark conditions. Surface reflectance refers to the ratio of solar radiation reflected by a surface object to incident solar radiation; it is dimensionless and ranges from 0 to 1. Surface reflectance can accurately reflect the time-series trend of water quality. In water environment monitoring scenarios, surface reflectance is often used as a basic parameter for water quality measurements, such as chlorophyll a concentration estimation and suspended sediment concentration inversion.
[0063] Specifically, cropping the pixels corresponding to surface reflectance that meet the abnormal conditions to obtain candidate images includes cropping the pixels corresponding to negative values and floating-point numbers greater than 1 to obtain candidate images.
[0064] S400 registers candidate images based on registration offset parameters to obtain a registered image cube; and performs geographic rotation on the registered image cube based on the positioning information and yaw angle in the metadata of the multispectral image to obtain a reflectance image cube.
[0065] Specifically, using the candidate image corresponding to the reference band as a benchmark, an affine transformation is performed on the candidate image corresponding to the intermediate band according to the registration offset parameters. After processing the candidate images corresponding to the five bands of 450nm, 530nm, 570nm, 650nm and 720nm in sequence, the candidate images of each band after affine transformation are deeply stacked in memory with the candidate image corresponding to 680nm to form a unified data structure, namely the registered image cube.
[0066] In one embodiment of this application, the dimensions of the registered image cube are H×W×6. H is the maximum length of the candidate image after the six-band affine transformation, and W is the maximum width of the candidate image after the six-band affine transformation.
[0067] Specifically, based on the positioning information and yaw angle in the metadata of the multispectral image, the registered image cube is geographically rotated to obtain a reflectance image cube, including:
[0068] The GPS coordinates and DLS yaw angle in the metadata are parsed. Using the GPS coordinates as the image center, the registered image cube is rotated in the opposite direction, with the rotation angle being the opposite of the DLS yaw angle.
[0069] Based on the rotated image cube, the ground pixel size, and the GPS coordinates, a WGS84 geographic transformation matrix is generated; wherein, the longitude direction is converted according to the latitude cosine, and the latitude direction is converted according to approximately 110,540 meters per degree.
[0070] Based on the WGS84 geographic transformation matrix and the rotated image cube, a reflectance image cube is obtained.
[0071] After obtaining the registered image cube, the candidate images after affine transformation of each band have been spatially aligned, but their orientation is still the original direction when the UAV was flying, and the mapping relationship between pixel coordinates and real geographic coordinates has not yet been established.
[0072] Therefore, this application parses the EXIF data to read the GPS coordinates and DLS yaw angle, and applies a reverse rotation to the registered image cube, with a rotation angle of -θ (i.e., if the DLS yaw angle is 30°, then a clockwise rotation of -30° is equivalent to a counterclockwise rotation of 30°).
[0073] After rotating the registered image cube, the image's pixel coordinate system is aligned with the geographic coordinate system, but it is still necessary to establish a mapping between pixel positions and actual latitude and longitude. Therefore, in this embodiment, a WGS84 geographic transformation matrix is generated. Based on the WGS84 geographic transformation matrix and the rotated image cube, a reflectance image cube is obtained.
[0074] The S500 adaptively crops the reflectance image cube and uses the surface reflectance in the visible light band to construct a high-brightness mask to remove water surface highlights, thus obtaining a corrected water spectral image.
[0075] Specifically, after geographic rotation, each layer of the reflectance image cube has data-free areas around its edges. Simultaneously, water surface specular reflection causes some pixels to exhibit abnormally high reflectance in the visible light band. Therefore, this application adaptively crops the data-free areas of the reflectance image cube. A specular mask is constructed using the surface reflectance in the visible light band, and this mask is used to remove water surface highlights. Here, the visible light band refers to the band corresponding to visible light in the initial band.
[0076] Specifically, after obtaining the corrected water spectral image, the process includes: updating the geographic window, updating image metadata, recording cropped pixels, and recording the number of highlight pixels. Updating the geographic window involves updating the latitude and longitude of the corrected water spectral image. Updating image metadata involves updating the width and height of the corrected water spectral image. Recording cropped pixels includes recording the number of cropped rows at the top edge, the number of cropped rows at the bottom edge, the number of cropped columns at the left edge, the number of cropped columns at the right edge, and the percentage of the total number of cropped pixels to the total number of pixels in the original image. Recording the number of highlight pixels involves counting and recording the total number of pixels marked as 1 in the highlight mask and their proportion to the total number of pixels in the image.
[0077] Based on S100-S500 sensors, this application uses the ORB algorithm to automatically calculate registration offset parameters, replacing manual matching and achieving high-precision batch registration. Furthermore, dual correction using reference brightness and dark offset values eliminates sensor noise, resulting in more accurate reflectivity calculations. Simultaneously, this application automatically reads GPS coordinates and DLS yaw angles to generate WGS84 geographic coordinates.
[0078] The above S200 will be described in detail below.
[0079] refer to Figure 2 , Figure 2 The flowchart illustrates the process of calculating the pixel offset of other images relative to the reference image through feature point matching to obtain the registration offset parameters.
[0080] like Figure 2 As shown in the embodiment of this application, the pixel offset of other images relative to the reference image is calculated by feature point matching to obtain the registration offset parameters, including S210 to S250.
[0081] In step S210, feature points from the reference image and other images are extracted and matched.
[0082] Specifically, the ORB algorithm is used to extract feature points from the reference image and other images for matching.
[0083] S220, calculate the horizontal and vertical offsets of each candidate point in other images. Candidate points are feature points that have been successfully matched.
[0084] Specifically, after feature point matching is completed, several successfully matched feature point pairs have been established between the reference image and other images. Assume a candidate point P in the reference image, with pixel coordinates (xp, yp). Another candidate point T in other images is successfully matched with candidate point P, with pixel coordinates (xt, yt). For P and T, a difference operation is performed to obtain the horizontal offset dx = xt - xp and the vertical offset dy = yt - yp.
[0085] S230, use the median of all horizontal offsets as the target horizontal offset.
[0086] Specifically, assuming that the reference image and other images have M pairs of successfully matched feature points, the M horizontal offsets are sorted in ascending order, and the median of the sorted horizontal offsets is taken as the target horizontal offset.
[0087] S240, use the median of all vertical offsets as the target vertical offset.
[0088] Specifically, the M vertical offsets are sorted in ascending order, and the median of the sorted vertical offsets is taken as the target vertical offset.
[0089] S250 uses the target's horizontal and vertical offsets as registration offset parameters for other images.
[0090] In one embodiment of this application, the registration offset parameters are saved as a JSON file.
[0091] Based on S210-S250, feature points of the reference image and other images are extracted using the ORB algorithm to obtain registration offset parameters. Compared with traditional manual point selection registration methods, this method effectively eliminates geometric misalignment between different bands of the multispectral camera and improves registration accuracy.
[0092] The following is for reference. Figure 3 , Figure 3 A flowchart illustrating the process of obtaining the surface reflectance of each pixel in the initial image in an embodiment of this application is shown.
[0093] like Figure 3 As shown, in S300, the surface reflectance of each pixel of the initial image is obtained based on the reference brightness value of each initial band and the dark offset value, including S310-S340.
[0094] S310 acquires the standard photograph taken with a standard gray card corresponding to each initial band.
[0095] S320: Extract the standard brightness value of the target area from the standard photo, and perform statistical calculations on the standard brightness value to obtain the reference brightness value of the initial band.
[0096] Specifically, the average of the standard brightness values of the target area in the standard photograph is used as the reference brightness value for the initial band.
[0097] S330, calculate the dark offset value of the initial image.
[0098] In one embodiment of this application, a step-by-step statistical method is used to independently calculate the dark offset value for each aerial image. The distribution of pixel brightness values for all pixels in the image is statistically analyzed, and a histogram of pixel brightness values is plotted. In the histogram, pixels with an accumulation ratio between 0.5% and 2% (i.e., the darkest 0.5% to 2% of pixels in the entire image) are extracted, starting from the lowest brightness value (0 value). For the extracted darkest pixel group, the arithmetic mean or median of its pixel brightness values is calculated as the dark offset value for that image in that initial band. If the calculated dark offset value exceeds ±30% of the reference dark offset value for that band, a system alarm is triggered, indicating an abnormal sensor status.
[0099] The dark offset value for each band is obtained by triggering camera exposure and acquiring dark-field images of each band before flight operations and under completely dark conditions. During calculation, for each band, the pixel values of a preset central region are extracted from the dark-field image. The mean or median of the pixel values in the preset central region is used as the dark offset value corresponding to that initial band.
[0100] S340, for each pixel of the initial image, the surface reflectance of the pixel is obtained based on the pixel's current brightness value, reference brightness value, and dark offset value.
[0101] Specifically, the surface reflectance of a pixel is equal to the standard reflectance of the initial band multiplied by the reflectance factor. The reflectance factor is equal to the quotient of the first difference divided by the second difference. The first difference is equal to the difference between the current brightness value and the dark offset value. The second difference is equal to the difference between the reference brightness value and the dark offset value.
[0102] That is, the surface reflectance of a pixel ρ = (DN - DN0) / (DN) ref -DN0)×ρ0, where DN is the current brightness value, DN0 is the dark offset value, and DN ref Using DN as the reference brightness value, ρ0 is the standard reflectivity of the initial band. It can be understood that when DN... ref When DN0 is less than the preset threshold, the process is skipped directly to protect the near-zero value of the denominator in the above formula.
[0103] In summary, by using the current brightness value, reference brightness value, and dark offset value of a pixel, the surface reflectance of the pixel is obtained, eliminating the inherent noise of the sensor and significantly improving the accuracy of radiometric calibration.
[0104] The S500 described above will be explained in detail below.
[0105] refer to Figure 4 , Figure 4 The flowchart illustrates the process of adaptively cropping a reflectance image cube and constructing a spectrophotometer using the surface reflectance in the visible light band to remove highlights from the water surface, resulting in a corrected spectral image of the water body.
[0106] like Figure 4 As shown in the embodiment of this application, the reflectance image cube is adaptively cropped, and a high-brightness mask is constructed using the surface reflectance in the visible light band to remove the highlights on the water surface, resulting in a corrected water spectral image, including S510-S540.
[0107] In step S510, the four sides of the reflectivity image cube are traversed and the clipping edges are identified. The clipping edges are the edges in the Z direction where all values are 0. The Z direction is the band direction in the reflectivity image cube.
[0108] Specifically, in the reflectance image cube H×W×6, the Z direction corresponds to the six bands, X to the W direction, and Y to the H direction. The four sides are Y=0, Y=H-1, X=0, and X=W-1. Taking a column along the Z direction as a spatial pixel position (e.g., Y=0, X=W-2), looking vertically downwards along the Z-axis, this is the vector formed by the reflectance values of the six bands at that coordinate. If the vector is [0, 0, 0, 0, 0, 0], then this column is the clipping edge.
[0109] The program scans the Y=0 side and finds that all Z columns are 0; it determines this is a clipping edge and deletes row 0. At this point, the original Y=1 is exposed, becoming the new outermost side (new Y=0). The program scans the new Y=0 again, checking if all Z columns at all X positions in this row are 0. This process repeats until at least one X position has a non-all Z column 0, at which point the clipping stops.
[0110] S520 clips the edges of the reflectivity image cube by setting the upper limit of the clipping pixels, thus obtaining a clipped 3D cube.
[0111] Specifically, a pixel limit is set for the four sides to be cropped, and the cropping edges of the reflectivity image cube are cropped to avoid cropping too much.
[0112] S530 constructs a hyperphoton mask by using the surface reflectance of the image corresponding to the visible light band in the cropped 3D cube.
[0113] In one embodiment of this application, constructing a specular mask using surface reflectance in the visible light band to remove water surface highlights includes: Mask initialization: generating a two-dimensional binary mask matrix with the same spatial size as the current image, with all pixels initially assigned a value of 0 (default normal). Pixel traversal and joint judgment: traversing each spatial pixel in the reflectance image cube, extracting the reflectance value vector of that location in the first 5 visible light bands. If the vector satisfies the specular highlight determination condition, the pixel is determined to be a water surface specular highlight pixel, and its value is assigned 1 in the mask matrix. The specular highlight determination condition is that the standard deviation of reflectance in the five visible light bands is less than a first preset threshold and greater than a second preset threshold.
[0114] Optionally, the first preset threshold is 0.2, and the second preset threshold is 0.03. The first and second preset thresholds can be calibrated according to the water type, solar altitude angle, and camera exposure parameters.
[0115] S540 fills the pixels belonging to the highlight area in the highlight mask with invalid values to obtain the corrected water spectral image.
[0116] In one embodiment of this application, the mask matrix is traversed, and for all pixel positions marked as 1, the corresponding reflectance values are forcibly overwritten with invalid values on all six bands of the original reflectance image cube.
[0117] In summary, by using a reflectance image cube for joint determination, a clipped edge is identified only when the reflectance of a certain spatial location is 0 in all six bands. This condition utilizes the physical characteristic that weak scattering signals (reflectance of approximately 0.01~0.03) still exist in the blue-green light bands (450nm, 530nm) in deep water areas, thus improving the recognition rate of clipped edges.
[0118] The following is in conjunction with the appendix Figure 5 A brief overview of the overall implementation process of the method in the embodiments of this application is provided.
[0119] refer to Figure 5 , Figure 5 A flowchart illustrating the overall implementation of the method in an embodiment of this application is shown.
[0120] like Figure 5 As shown, the overall implementation process of the method in this application includes performing band offset calculation (automatically solving dx / dy) on the original multispectral aerial images (450nm, 530nm, 570nm, 650nm, 680nm, and 720nm) to obtain a JOSN file of offset parameters. Based on the JOSN file of offset parameters, integrated radiometric geometric correction (radiometric calibration + geometric correction) is performed to obtain a six-band reflectance GeoTIFF (0-1). The six-band reflectance GeoTIFF is then post-processed for edge trimming and highlight removal (edge trimming + highlight removal) to obtain a standardized remote sensing image (no black borders, no highlights). Specifically, GeoTIFF is an extended format formed by embedding a set of specific geographic metadata tags in its file header.
[0121] The band offset calculation includes: inputting a single set of 6-band aerial images (450nm, 530nm, 570nm, 650nm, 680nm, and 720nm); selecting 680nm as the reference band; using the ORB algorithm to extract feature points from the reference and the remaining 5 band aerial images respectively; feature matching; calculating the horizontal dx and vertical dy offsets of corresponding points; median filtering to remove mismatch noise; checking if all 5 bands have been calculated; if not, switching to the next band to be matched; if yes, saving the scene-by-scene offset parameter JOSN file.
[0122] The integrated radiometric geometric correction includes: Input 1: original six-band aerial image, Input 2: standard gray TIFF image, and Input 3: offset parameter JSON file; Branch 1 (radiometric preprocessing) reads the gray ROI and calculates the standard DN reference value by band; Branch 2 (dark noise processing) counts dark pixels on a map-by-map basis and calculates dark offset values; gray linear model is used to convert the surface reflectance from 0 to 1 and crop outliers; offset parameters are read and artificially corrected affine transformation is superimposed to complete band registration and alignment at 680nm; EXIF data is parsed to read GPS coordinates and DLS yaw angle; the image is rotated in reverse to true north to generate a WGS84 geographic transformation matrix; output is a six-band reflectance GeoTIFF with geographic coordinates, and metadata is written to all correction parameters.
[0123] The post-processing for edge trimming and de-reflection includes: inputting the corrected six-band reflectance GeoTIFF; traversing the image cube to identify invalid black edges with zero values on all four sides; setting a pixel limit and adaptively trimming the edges; extracting the first five visible light bands to construct a highlight detection mask; filling the highlight areas with invalid values; updating the geographic window and image metadata, and recording the number of cropped pixels and highlight pixels; and outputting a finished multispectral TIFF without black edges and with water surface reflection removed.
[0124] In summary, using 680nm as the benchmark, the ORB algorithm is used to automatically extract and match feature points, combined with median filtering to replace manual operation; through grayboard calibration and dark offset values, the calculation of surface reflectance is made more accurate.
[0125] This application also provides an electronic device, which includes a processor and a memory. The memory stores at least one instruction or at least one program. The processor loads and executes the instruction or program to implement the UAV water spectral image correction method described in the above embodiments. The specific functions and corresponding technical effects can be found in the explanations of the embodiments corresponding to the UAV water spectral image correction method described above, and will not be repeated here.
[0126] Now for reference Figure 6 The diagram shown is a block diagram of an electronic device 1200 according to an embodiment of this application. The electronic device 1200 may include one or more processors (corresponding to...) coupled to a controller hub 1203. Figure 6 The first processor 1201 is described above. In at least one embodiment, the controller hub 1203 communicates with the first processor 1201 via a multi-branch bus such as a Front Side Bus (FSB), a point-to-point interface such as a Quick Path Interconnect (QPI), or a similar connection. The first processor 1201 executes instructions that control general types of data processing operations. In one embodiment, the controller hub 1203 includes, but is not limited to, a graphics memory controller hub (GMCH) (not shown) and an input / output hub (IOH) (which may be on a separate chip) (not shown), wherein the GMCH includes memory and a graphics controller and is coupled to the IOH.
[0127] Electronic device 1200 may also include a coprocessor coupled to controller hub 1203 (corresponding to...) Figure 6The processor 1202 and memory 1204 are integrated within the processor (as described in this application). Alternatively, one or both of the memory and GMCH can be integrated within the processor (as described in this application), with memory 1204 and the first coprocessor 1202 directly coupled to the first processor 1201 and the controller hub 1203, which is located on a single chip with the IOH. Memory 1204 can be, for example, dynamic random access memory (DRAM), phase change memory (PCM), or a combination of both. In one embodiment, the first coprocessor 1202 is a dedicated processor, such as a high-throughput MIC processor (many integrated core, MIC), a network or communication processor, a compression engine, a graphics processor, a general-purpose computing on GPU (GPGPU), or an embedded processor, etc. Optional properties of the first coprocessor 1202 are indicated by dashed lines. Figure 6 middle.
[0128] As a computer-readable storage medium, memory 1204 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. For example, memory 1204 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device such as one or more hard-disk drives (HDDs), one or more compact disc (CD) drives, and / or one or more digital versatile disc (DVD) drives.
[0129] In one embodiment, electronic device 1200 may further include network interface 1206. Network interface 1206 may include a transceiver for providing a radio interface for electronic device 1200 to communicate with any other suitable device (such as a front-end module, antenna, etc.). In various embodiments, network interface 1206 may be integrated with other components of electronic device 1200. Network interface 1206 can implement the functions of the communication unit in the above embodiments.
[0130] Electronic device 1200 may further include input / output (I / O) device 1205. I / O device 1205 may include: a user interface designed to enable a user to interact with electronic device 1200; a peripheral component interface designed to enable peripheral components to also interact with electronic device 1200; and / or sensors designed to determine environmental conditions and / or location information related to electronic device 1200.
[0131] It is worth noting that, Figure 6 This is merely an example. That is, although... Figure 6 The electronic device 1200 shown includes multiple devices such as a first processor 1201, a first coprocessor 1202, a controller hub 1203, and a memory 1204. However, in actual applications, devices using the methods of this application may include only a portion of the devices in the electronic device 1200. For example, it may include only the first processor 1201 and the network interface 1206. Figure 6 The properties of the optional devices are shown in dashed lines. According to some embodiments of this application, the memory 1204, which is a computer-readable storage medium, stores instructions that, when executed on a computer, cause the electronic device 1200 to perform a diagnostic method for abnormal emissions of volatile organic compounds according to the above embodiments. Specific details can be found in the methods described in the above embodiments, and will not be repeated here.
[0132] Now for reference Figure 7 The diagram shown is a block diagram of a SoC (system on chip) 1300 according to an embodiment of this application. Figure 7 In the diagram, similar components share the same reference numerals. Additionally, dashed boxes are an optional feature for more advanced SoCs. Figure 7 In the SoC1300, interconnect unit 1350 is coupled to the processor (corresponding to...). Figure 7 The system includes a second processor 1310, a system agent unit 1380, a bus controller unit 1390, an integrated memory controller unit 1340, and one or more coprocessors (corresponding to...). Figure 7 The second coprocessor 1320 may include integrated graphics logic, an image processor, an audio processor, and a video processor; a static random access memory (SRAM) unit 1330; and a direct memory access (DMA) unit 1360. In one embodiment, the second coprocessor 1320 includes a dedicated processor, such as a network or communication processor, a compression engine, a GPGPU, a high-throughput MIC processor, or an embedded processor.
[0133] The static random access memory (SRAM) cell 1330 may include one or more computer-readable media for storing data and / or instructions. The computer-readable storage medium may store instructions, specifically, temporary and permanent copies of those instructions. These instructions may include, when executed by at least one unit in the processor, causing the SoC 1300 to perform a diagnostic method for abnormal volatile organic compound emissions according to the above embodiments, specifically referring to the methods in the above embodiments, which will not be repeated here.
[0134] Various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or combinations of these implementation methods. Embodiments of this application can be implemented as computer programs or program code executable on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0135] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the accompanying drawings. Furthermore, including structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.
[0136] This application also provides a computer-readable storage medium storing at least one instruction or at least one program, which is loaded and executed by a processor to implement the diagnostic method for abnormal volatile organic compound emissions as described in the above embodiments. The specific functions and corresponding technical effects can be found in the explanations of the embodiments corresponding to the diagnostic method for abnormal volatile organic compound emissions described above, and will not be repeated here.
[0137] It should be noted that all units / modules mentioned in the device embodiments of this application are logical units / modules. Physically, a logical unit / module can be a physical unit / module, a part of a physical unit / module, or a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important factor; the combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed in this application. Furthermore, to highlight the innovative aspects of this application, the above-described device embodiments of this application have not introduced units / modules that are not closely related to solving the technical problems proposed in this application. This does not mean that the above-described device embodiments do not contain other units / modules.
[0138] It should be noted that in the examples and description of this application, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0139] Although this application has been illustrated and described with reference to certain preferred embodiments thereof, those skilled in the art should understand that various changes in form and detail may be made thereto without departing from the spirit and scope of this application.
Claims
1. A method for correcting spectral images of water bodies using unmanned aerial vehicles (UAVs), characterized in that, The method includes: Acquire multispectral images of the target water body, wherein the multispectral images include initial images of multiple initial bands; An initial image of one band is determined from the initial images of the multiple initial bands as a reference image, and the pixel offset of other images relative to the reference image is calculated by feature point matching to obtain the registration offset parameters. The other images are initial images other than the reference image. The dark offset value of each initial image is determined, and the surface reflectance of each pixel of the initial image is obtained based on the reference brightness value of each initial band and the dark offset value. The pixels corresponding to the surface reflectance that meet the abnormal conditions are cropped to obtain candidate images. The candidate images are registered based on the registration offset parameters to obtain a registered image cube; and the registered image cube is geographically rotated based on the positioning information and yaw angle in the metadata of the multispectral images to obtain a reflectance image cube. The reflectance image cube is adaptively cropped, and a high-brightness mask is constructed using the surface reflectance in the visible light band to remove highlights on the water surface, resulting in a corrected water spectral image.
2. The method for correcting UAV water spectral images according to claim 1, characterized in that, The multispectral image includes initial images of six initial bands, with center wavelengths of 450 nm, 530 nm, 570 nm, 650 nm, 680 nm, and 720 nm, respectively.
3. The UAV water spectral image correction method according to claim 2, characterized in that, The center wavelength of the reference band of the reference image is 680 nanometers.
4. The UAV water spectral image correction method according to claim 1, characterized in that, The step of calculating the pixel offset of other images relative to the reference image through feature point matching to obtain registration offset parameters includes: Feature points of the reference image and feature points of the other images are extracted respectively, and feature point matching is performed. Calculate the horizontal and vertical offsets of each candidate point in the other images, where the candidate points are the successfully matched feature points; Use the median of all the horizontal offsets as the target horizontal offset; The median of all the vertical offsets is taken as the target vertical offset. The target horizontal offset and the target vertical offset are used as the registration offset parameters for the initial bands corresponding to the other images.
5. The method for correcting UAV water spectral images according to claim 1, characterized in that, The method of obtaining the surface reflectance of each pixel in the initial image based on the reference brightness value and the dark offset value of each initial band includes: Obtain standard photographs taken with a standard gray card for each of the initial bands; Extract the standard brightness value of the target area from the standard image, and perform statistical calculations on the standard brightness value to obtain the reference brightness value of the initial band; Calculate the dark offset value of the initial image; For each pixel of the initial image, the surface reflectance of the pixel is obtained based on the pixel's current brightness value, the reference brightness value, and the dark offset value.
6. The UAV water spectral image correction method according to claim 5, characterized in that, The surface reflectance of the pixel is equal to the standard reflectance of the initial band multiplied by the reflectance factor, the reflectance factor is equal to the quotient of the first difference divided by the second difference, the first difference is equal to the difference between the current brightness value and the dark offset value, and the second difference is equal to the difference between the reference brightness value and the dark offset value.
7. The method for correcting UAV water spectral images according to claim 1, characterized in that, The adaptive cropping of the reflectance image cube and the construction of a spectrophotometer using the surface reflectance in the visible light band to remove water surface highlights, resulting in a corrected water spectral image, includes: Traverse the four sides of the reflectivity image cube and identify the clipping edges, which are the edges of the side where all values in a column along the Z direction are 0; where the Z direction is the band direction in the reflectivity image cube; By setting an upper limit for the number of pixels to be clipped, the clipping edges of the reflectivity image cube are clipped to obtain a clipped three-dimensional cube. A hyperphoton mask is constructed using the surface reflectance of the cropped three-dimensional cube and the image corresponding to the visible light band. The pixels belonging to the highlight area in the highlight mask are filled with invalid values to obtain the corrected water spectral image.
8. 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 UAV water spectral image correction method as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the UAV water spectral image correction method as described in any one of claims 1-7.
10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by the processor, the UAV water spectral image correction method according to any one of claims 1-7 is implemented.
