A multi-level adaptive remote sensing image stretching method, device and medium
Through the multi-level adaptive image stretching method, the problem of overexposure of ground objects during the remote sensing image drop is solved, and the high-fidelity display and visual effect of remote sensing images are achieved.
Patent Information
- Application Number
- CN202510150118.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-02-11
AI Technical Summary
When the remote sensing image is lowered from 16 bits to 8 bits, it is easy to cause overexposure of the highlighted area of the ground object, resulting in poor visual perception and loss of the ground object details.
A multi-level adaptive image stretching method is adopted to achieve compensation for the overexposure area through initial hierarchical overall stretching, overexposure area separation, feather mask creation and sub-hierarchical stretching, combined with image mask and feather mask for image superposition.
When ensuring the overall brightness of the image is suitable, compensate for overexposed ground objects, improve the visual perception of remote sensing images, and retain ground objects texture information, avoid overexposure of ground objects, and improve image display effect.
Smart Images

Figure CN120163704B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of remote sensing image stretching and de-positioning, and in particular to a multi-level adaptive remote sensing image stretching method, device and medium. Background Art
[0002] Remote sensing imaging technology is an important means of obtaining surface information and is widely used in areas such as map services and land feature classification and identification. In remote sensing image processing, raw remote sensing images are typically 16-bit. In practical applications, display devices generally have an 8-bit color depth, meaning most display devices only support 8-bit images. Therefore, in remote sensing image applications, it is often necessary to downscale the 16-bit raw images to 8-bit images through image stretching to enable image map publishing and land feature identification.
[0003] In remote sensing images, the original 16-bit unsigned image corresponds to a pixel value range of 0-65535, while the 8-bit unsigned image commonly used in practical applications corresponds to a pixel value range of 0-255. Stretching and reducing from 16 bits to 8 bits will inevitably lose some information. In practical applications, percentage truncation stretching can be used to reduce the image bit rate. The 16-bit image is truncated and normalized by determining the maximum and minimum values at the percentage truncation point, and then expanded to an 8-bit image. In this process, pixels in the 16-bit image that are greater than the maximum percentage truncation value and less than the minimum percentage truncation value will be discarded. Discarding pixels with larger values will usually cause overexposure of highlighted areas in the ground objects (such as roofs, airplanes, stadiums, etc.), resulting in poor visual perception and loss of original details of the ground objects.
[0004] For example, invention application number 201810541057.0 discloses a nonlinear transformation method suitable for downscaling and enhancing remote sensing imagery, relating to the field of remote sensing image processing technology. This application scheme can achieve enhanced contrast while downscaling remote sensing images, resulting in a good visual effect for the downscaled and enhanced images. However, it also suffers from the problem of not being able to balance brightness and ground detail during stretching, which can easily lead to overexposure.
[0005] Therefore, a multi-level adaptive image stretching method is needed in reality to compensate for overexposed objects while ensuring the overall brightness of the stretched image is appropriate, so that the remote sensing image has a better visual perception while retaining more texture information of the objects. Summary of the Invention
[0006] In response to the above-mentioned problems, the purpose of the present invention is to provide a multi-level adaptive remote sensing image stretching method, equipment and medium. Through the multi-level adaptive image stretching method, the overexposed objects produced after image stretching are compensated, the detailed texture of the overexposed objects is restored, and the remote sensing image achieves better visual effects.
[0007] The embodiments of the present invention provide a multi-level adaptive remote sensing image stretching method, device and medium.
[0008] A first aspect: A multi-level adaptive remote sensing image stretching method, comprising:
[0009] S1. Performing initial-level overall stretching on the original image, adjusting the overall appropriate brightness of the image, and obtaining an initial-level stretched image;
[0010] S2, separating the overexposed area in the image and creating an image mask for the overexposed area;
[0011] S3. Create a feathered mask based on the image mask;
[0012] S4, performing sub-level overall stretching on the original image, retaining the detailed texture of the objects that are easily overexposed in the image, and obtaining a sub-level stretched image;
[0013] S5, performing a superposition operation on the initial layer and the overall stretched image of the sub-layer to obtain a compensated image of the overexposed area;
[0014] S6. Detect the compensated image to determine whether it meets the output conditions;
[0015] S7. If the output condition is met, the processing is completed and the image is output; if the condition is not met, steps S2-S6 are repeated using the compensated image until the condition is met.
[0016] Furthermore, the overall stretching of the image in S1 or S4 includes:
[0017] Arrange the image pixel values N from small to large, set the truncation low value min and the truncation high value max, truncate the image pixels according to the set truncation values, and stretch the truncation image pixel values to 0-255.
[0018] Furthermore, the step of creating the image mask M in S2 includes:
[0019] Set the threshold of overexposed pixels and separate the overexposed area of the stretched image based on the threshold. Pixels smaller than the threshold have a pixel value of 0 on the mask image, and pixels greater than or equal to the threshold have a pixel value of 1 on the mask image.
[0020] Furthermore, the feathering mask in S3 is expressed as follows:
[0021]
[0022] Where x, y are the image pixel coordinates, r is the feathering radius, M(x, y) is the image mask, and d is the closest distance from the pixel coordinate to the 1 value in the image mask M.
[0023] Furthermore, when setting the percentage truncation stretching parameter of the sub-level in S4, the low ratio truncation parameter of the sub-level is smaller than the low ratio truncation parameter of the previous level, and the high ratio truncation parameter is larger than the high ratio truncation parameter of the previous level.
[0024] Furthermore, the compensation image of the overexposed area is obtained in S5, and the formula is expressed as:
[0025] S3(x,y)=S1(x,y)*(1-F(x,y))+S2(x,y)*F(x,y)
[0026] Among them, S1(x,y) is the initial level stretched image, S2(x,y) is the secondary level stretched image, and S3(x,y) is the compensation image.
[0027] Furthermore, the compensation image is detected in S6 based on calculating the percentage of overexposed pixels in the entire image.
[0028] A second aspect: An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method provided in the first aspect when executing the program.
[0029] A third aspect: A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method provided in the first aspect.
[0030] Beneficial effects of the present invention:
[0031] 1. The multi-level adaptive remote sensing image stretching method of the present invention uses an image mask to segment the non-overexposed area and the overexposed area through multi-level adaptive image stretching to determine the overexposure compensation area, and feathers the junction of the non-overexposed area and the overexposed area using a feathering mask to ensure a natural transition of color at the junction.
[0032] 2. The multi-level adaptive remote sensing image stretching method of the present invention compensates for overexposed objects while ensuring that the overall brightness of the image after stretching is appropriate, thereby making the remote sensing image have a better visual perception and retaining more texture information of the objects. It can avoid overexposure of the objects during image stretching, improve the display effect of the remote sensing image and the function of object discrimination, and has the characteristics of multi-level adaptive overexposure compensation and natural color transition at the boundaries of overexposed objects. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A schematic flow chart of a multi-level adaptive remote sensing image stretching method according to the present invention;
[0034] Figure 2 This is a principle flow chart of a multi-level adaptive remote sensing image stretching method of the present invention;
[0035] Figure 3 4 block images without overexposure compensation using a common stretching method in the embodiment;
[0036] Figure 4 for Figure 3 The corresponding four block images in the figure are overexposure compensation sample images after the stretching method of the present invention is used;
[0037] Figure 5 It is a schematic diagram of the structure of the electronic device of the present invention. DETAILED DESCRIPTION
[0038] The following describes embodiments of the present invention in detail. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar symbols throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended only to explain the present invention and are not to be construed as limiting the present invention.
[0039] Currently, when stretching and downscaling remote sensing images from 16 bits to 8 bits, some pixel information will inevitably be lost. The process of discarding pixels with larger values usually causes overexposure of bright areas in the ground objects (such as roofs, airplanes, stadiums, etc.), resulting in poor visual perception and loss of the original details of the ground objects.
[0040] In order to solve the above problems, the present invention provides a multi-level adaptive remote sensing image stretching method. Figure 1 A schematic diagram of a multi-level adaptive remote sensing image stretching method according to an embodiment of the present invention is provided. Figure 2 The principle flow chart of the multi-level adaptive remote sensing image stretching method provided by an embodiment of the present invention includes:
[0041] S1. Performing initial-level overall stretching on the original image, adjusting the overall appropriate brightness of the image, and obtaining an initial-level stretched image.
[0042] The main purpose of reasonably setting the percentage cutoff stretching parameters of the initial level is to ensure that the overall brightness of the image after the initial level stretching is more appropriate, without having to worry too much about the detailed texture of the objects that are prone to overexposure.
[0043] For example, the low ratio cutoff parameter can be set to 0.1%, and the high ratio cutoff parameter can be set to 99.9%. Then, the image is stretched. That is, when the total number of image pixel values is N, the pixel values are arranged from small to large, and the value at the N*0.1% position is set to the cutoff low value min, and the value at the N*99.9% position is set to the cutoff high value max. After truncation, the image pixel values between min and max are retained, and then the truncated image pixel values are stretched to 0-255, thereby achieving the initial overall stretching of the original image and obtaining the initial hierarchical stretched image S1.
[0044] The initial-level stretched image S1 is relatively appropriate in brightness, with the main area not overexposed and some areas overexposed. The overexposed areas in the initial-level stretched image can be compensated using subsequent sub-level stretched images, thereby ensuring that the bright objects are not overexposed while the overall brightness of the stretched image is appropriate, thereby achieving high-fidelity image stretching of remote sensing images and retaining image details and textures.
[0045] S2. Separate the overexposed area in the image and create an image mask for the overexposed area.
[0046] An overexposed area in the image is separated to create an image mask M. The image used to create the image mask M can be the initial level stretched image S1 or the compensated image S3 by using a threshold segmentation method.
[0047] Take the initial level stretched image S1 as an example: set a threshold for overexposed pixels. Pixels in the stretched image S1 that are smaller than the threshold have a pixel value of 0 on the mask image, and pixels in the stretched image that are greater than or equal to the threshold have a pixel value of 1 on the mask image.
[0048] Taking the compensated image S3 as an example: a threshold for overexposed pixels is set. Pixels in the compensated image S3 that are smaller than the threshold have a pixel value of 0 on the mask image, and pixels in the stretched image that are greater than or equal to the threshold have a pixel value of 1 on the mask image.
[0049] Through the above method, an image mask M with the same size as the image is created for the overexposed area in the image.
[0050] S3. Create a feathered mask based on the image mask;
[0051] Based on the image mask M, a feathering mask F is created according to the feathering radius. Specifically:
[0052] The feathered mask F is initialized with the value of the image mask M, and then the zero-valued pixels in the feathered mask F are operated according to the formula:
[0053]
[0054] Where x, y are the image pixel coordinates, r is the feathering radius, and d is the closest distance between the pixel coordinate and the value 1 in the mask M.
[0055] S4. Perform sub-level overall stretching on the original image, retaining the detailed texture of the easily overexposed ground objects in the image, and obtaining a sub-level stretched image.
[0056] Reasonably set the percentage truncation stretching parameters of the sub-level and stretch the original image as a whole. The main purpose is to retain the detailed texture of the easily overexposed ground objects after the sub-level stretching. The sub-level stretching in the present invention is an iterative process.
[0057] The low ratio truncation parameter of the sub-level is smaller than that of the previous level, and the high ratio truncation parameter is larger than that of the previous level. For example, the low ratio truncation parameter is set to 0.05%, and the high ratio truncation parameter is set to 99.95%. Then, stretching is performed according to step S1 to obtain the sub-level stretched image S2.
[0058] S5. Superimpose the initial layer and the overall stretched sub-layer images to obtain a compensated image of the overexposed area.
[0059] The initial level stretched image S1(x, y) and the secondary level stretched image S2(x, y) are combined with the feathering mask F to perform a superposition operation to obtain the compensation image S3(x, y) of the overexposed area. The operation rules are as follows:
[0060] S3(x,y)=S1(x,y)*(1-F(x,y))+S2(x,y)*F(x,y)
[0061] Where x and y are the image pixel coordinates.
[0062] S6. Detect the compensated image to determine whether it meets the output conditions.
[0063] The compensated image S3(x,y) is tested and the percentage of overexposed pixels in the entire image is calculated, that is, the percentage of pixels exceeding the threshold is counted to determine whether the set output conditions are met.
[0064] S7. If the output condition is met, the processing is completed and the image is output; if the condition is not met, steps S2-S6 are repeated using the compensated image until the condition is met.
[0065] like Figure 3 As shown, Figure 3 The four block images are the effect pictures achieved by the ordinary stretching method. The four block images have not been overexposed. It can be seen from the image effects that the bright areas of the objects (such as roofs, airplanes, stadiums, etc.) are overexposed, resulting in poor visual perception and the original details of the objects are also lost.
[0066] like Figure 4 As shown, Figure 4 The four block images are the effect diagrams achieved by the stretching method of the present invention. The four block images are overexposed using the method of the present invention. From the image effect, it can be seen that the overall brightness of the image after stretching is appropriate. Figure 3 The overexposed ground objects are compensated, so that the remote sensing image has a better visual perception while retaining more ground texture information.
[0067] The multi-level adaptive remote sensing image stretching method of the present invention uses an image mask to segment the non-overexposed area and the overexposed area through multi-level adaptive image stretching to determine the overexposure compensation area, and feathers the junction between the non-overexposed area and the overexposed area using a feathering mask to ensure a natural transition of color at the junction.
[0068] The present invention also provides an electronic device, Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 5 As shown, the electronic device may include: a processor, a communications interface, a memory, and a communication bus, wherein the processor, the communications interface, and the memory communicate with each other via the communication bus. The processor may call logic instructions in the memory, for example, to execute the following method:
[0069] S1. Performing initial-level overall stretching on the original image, adjusting the overall appropriate brightness of the image, and obtaining an initial-level stretched image;
[0070] S2, separating the overexposed area in the image and creating an image mask for the overexposed area;
[0071] S3. Create a feathered mask based on the image mask;
[0072] S4, performing sub-level overall stretching on the original image, retaining the detailed texture of the objects that are easily overexposed in the image, and obtaining a sub-level stretched image;
[0073] S5, performing a superposition operation on the initial layer and the overall stretched image of the sub-layer to obtain a compensated image of the overexposed area;
[0074] S6. Detect the compensated image to determine whether it meets the output conditions;
[0075] S7. If the output condition is met, the processing is completed and the image is output; if the condition is not met, steps S2-S6 are repeated using the compensated image until the condition is met.
[0076] In addition, the logical instructions in the above-mentioned memory can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.
[0077] An embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method provided in each of the above embodiments is implemented, for example, including:
[0078] S1. Performing initial-level overall stretching on the original image, adjusting the overall appropriate brightness of the image, and obtaining an initial-level stretched image;
[0079] S2, separating the overexposed area in the image and creating an image mask for the overexposed area;
[0080] S3. Create a feathered mask based on the image mask;
[0081] S4, performing sub-level overall stretching on the original image, retaining the detailed texture of the objects that are easily overexposed in the image, and obtaining a sub-level stretched image;
[0082] S5, performing a superposition operation on the initial layer and the overall stretched image of the sub-layer to obtain a compensated image of the overexposed area;
[0083] S6. Detect the compensated image to determine whether it meets the output conditions;
[0084] S7. If the output condition is met, the processing is completed and the image is output; if the condition is not met, steps S2-S6 are repeated using the compensated image until the condition is met.
[0085] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0086] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A multi-level adaptive remote sensing image stretching method, characterized in that: include: S1. Performing initial-level overall stretching on the original image, adjusting the overall appropriate brightness of the image, and obtaining an initial-level stretched image; S2, separating the overexposed area in the image and creating an image mask for the overexposed area; S3. Create a feathered mask based on the image mask; S4, performing sub-level overall stretching on the original image, retaining the detailed texture of the objects that are easily overexposed in the image, and obtaining a sub-level stretched image; S5, performing a superposition operation on the initial layer and the overall stretched image of the sub-layer to obtain a compensated image of the overexposed area; S6. Detect the compensated image to determine whether it meets the output conditions; S7. If the output condition is met, the processing is completed and the image is output; if the condition is not met, steps S2-S6 are repeated using the compensated image until the condition is met.
2. The stretching method according to claim 1, wherein The overall image stretching in S1 or S4 includes: Arrange the image pixel values N from small to large, set the truncation low value min and the truncation high value max, truncate the image pixels according to the set truncation values, and stretch the truncation image pixel values to 0-255.
3. The stretching method according to claim 1, wherein The step S2 of creating the image mask M includes: Set the threshold of overexposed pixels and separate the overexposed area of the stretched image based on the threshold. Pixels smaller than the threshold have a pixel value of 0 on the mask image, and pixels greater than or equal to the threshold have a pixel value of 1 on the mask image.
4. The stretching method according to claim 1, wherein The feathering mask in S3 is expressed as follows: Where x, y are the image pixel coordinates, r is the feathering radius, M(x, y) is the image mask, and d is the closest distance from the pixel coordinate to the 1 value in the image mask M.
5. The stretching method according to claim 1, wherein When setting the percentage truncation stretching parameter of the sub-level in S4, the low ratio truncation parameter of the sub-level is smaller than the low ratio truncation parameter of the previous level, and the high ratio truncation parameter is larger than the high ratio truncation parameter of the previous level.
6. The stretching method according to claim 1, wherein The compensation image of the overexposed area is obtained in S5, and the formula is expressed as: S3(x,y)=S1(x,y)*(1-F(x,y))+S2(x,y)*F(x,y) Among them, S1(x,y) is the initial level stretched image, S2(x,y) is the secondary level stretched image, and S3(x,y) is the compensation image.
7. The stretching method according to claim 1, wherein The compensation image is detected in S6 based on calculating the percentage of overexposed pixels in the entire image.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the stretching method according to any one of claims 1 to 7 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the stretching method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
A nonlinear transformation method suitable for downscaling and enhancing remote sensing images
CN108846811B
Multispectral remote sensing image real color reduction method and system
CN107507151A
Remote sensing image visualization enhancement method based on guiding filtering
CN118967455A