Multi-level self-adaptive remote sensing image stretching method, equipment and medium
Through a multi-level adaptive image stretching method, combined with image mask and feather mask, the problems of overexposure and detail loss in the process of remote sensing image deposition are solved, and high-quality remote sensing image stretching effect is achieved.
Patent Information
- Application Number
- CN202510150118.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-02-11
AI Technical Summary
In the process of remote sensing images falling from 16 bits to 8 bits, the commonly used percentage truncation stretching method will cause overexposed areas of the land object to be highlighted, and the details of the land object will be lost, resulting in poor visual perception and limited visual discrimination function.
A multi-level adaptive image stretching method is adopted to separate and compensate for the overexposure area through overall stretching of the initial and sub-level levels, combining the image mask and feather mask, ensuring the appropriate brightness of the image and retaining the details of the land.
It realizes the detailed texture recovery of overexposed ground objects while ensuring the appropriate overall brightness of the image, improves the visual perception and ground objects discrimination functions of remote sensing images, and avoids the phenomenon of ground objects overexposure.
Smart Images

Figure CN120163704A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of remote sensing image stretching and bit reduction, 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 to obtain surface information, and remote sensing images are widely used in fields such as map services and land object classification and discrimination. In remote sensing image processing, the original remote sensing image is generally a 16-bit image. In practical applications, the display device generally has an 8-bit color depth, that is, most display devices only support displaying 8-bit images. Therefore, in the application of remote sensing images, it is usually necessary to reduce the bit of the 16-bit original image to an 8-bit image by image stretching to realize the release of image maps and the discrimination of land objects.
[0003] In a remote sensing image, the pixel value range corresponding to the original 16-bit unsigned image is 0 - 65535, and the pixel value range corresponding to the commonly used 8-bit unsigned image in practical applications is 0 - 255. When stretching and reducing the bit from 16 bits to 8 bits, some information will inevitably be lost. In practical applications, percentage truncation stretching can be used to perform bit reduction processing on the image. By determining the maximum and minimum values at the percentage truncation, the 16-bit image is truncated and normalized, and then expanded to an 8-bit image. During this process, the pixels in the 16-bit image that are greater than the percentage truncation maximum value and less than the percentage truncation minimum value will be discarded. The processing of discarding the larger pixel values usually causes overexposure of the highlighted areas in land objects (such as roofs, airplanes, stadiums, etc.), resulting in a poor visual perception and also losing the original details of the land objects.
[0004] For example: The invention application with the application number 201810541057.0 discloses a non-linear transformation method suitable for remote sensing image bit reduction and enhancement display, which relates to the technical field of remote sensing image processing. Through this application solution, while reducing the bit display of the remote sensing image, the contrast of the image display can be enhanced, so that the image after bit reduction and enhancement display has a good visual effect. However, at the same time, it has the problem that when stretching, the relationship between brightness and land object details cannot be taken into account, and overexposure is likely to occur.
[0005] Therefore, in reality, a multi-level adaptive image stretching method is needed to compensate for overexposed land objects while ensuring that the overall brightness of the stretched image is appropriate, so that the remote sensing image has a better visual perception and at the same time retains more land object texture information. Summary of the Invention
[0006] In view of the above problems, the purpose of the present invention is to provide a multi-level adaptive remote sensing image stretching method, device and medium. Through the multi-level adaptive image stretching method, the overexposed ground objects generated after image stretching are compensated, so as to realize the restoration of the detailed texture of the overexposed ground objects and make the remote sensing image achieve a better visual effect.
[0007] An embodiment of the present invention provides a multi-level adaptive remote sensing image stretching method, device and medium.
[0008] First aspect: A multi-level adaptive remote sensing image stretching method, comprising:
[0009] S1. Perform an initial-level overall stretch on the original image, adjust the overall appropriate brightness of the image, and obtain an initial-level stretched image;
[0010] S2. Isolate the overexposed area in the image, and create an image mask for the overexposed area;
[0011] S3. Create a feathered mask based on the image mask;
[0012] S4. Perform a secondary-level overall stretch on the original image, retain the detailed texture of the ground objects in the image that are prone to overexposure, and obtain a secondary-level stretched image;
[0013] S5. Perform a superposition operation on the images after the initial-level and secondary-level overall stretches to obtain a compensated image for the overexposed area;
[0014] S6. Detect the compensated image and determine whether the output condition is met;
[0015] S7. If the output condition is met, the processing is completed and the image is output; if the condition is not met, use the compensated image to repeat steps S2 - S6 until the condition is met.
[0016] Further, the overall stretch of the image in S1 or S4 includes:
[0017] Arrange the image pixel values N from small to large, set a truncation low value min and a truncation high value max, truncate the image pixels according to the set truncation values, and stretch the truncated image pixel values to 0 - 255.
[0018] Further, creating the image mask M in S2 includes:
[0019] Set the threshold of overexposed pixels, isolate the overexposed area of the stretched image according to the threshold, the pixel value of the pixels smaller than the threshold is 0 on the mask image, and the pixel value of the pixels greater than or equal to the threshold is 1 on the mask image.
[0020] Further, the feathered mask in S3 is expressed by the formula:
[0021]
[0022] Among them, x and y are the pixel coordinates of the image, r is the feathering radius, M(x, y) is the image mask, and d is the shortest distance from the pixel coordinates to the value 1 in the image mask M.
[0023] Furthermore, when setting the percentage truncation stretching parameters of the sub-level in S4, the low ratio truncation parameter of the sub-level is less than that of the upper level, and the high ratio truncation parameter is greater than that of the upper level.
[0024] Furthermore, in S5, the compensated image of the overexposed area is obtained, 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 stretched image of the initial level, S2(x, y) is the stretched image of the sub-level, and S3(x, y) is the compensated image.
[0027] Furthermore, the basis for detecting the compensated image in S6 is to calculate the percentage of overexposed pixels in the whole image.
[0028] Second aspect: An electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the method provided in the first aspect are implemented.
[0029] Third aspect: A non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method provided in the first aspect are implemented.
[0030] Advantages of the present invention:
[0031] 1. The multi-level adaptive remote sensing image stretching method of the present invention realizes the determination of the overexposure compensation area by using an image mask to segment the non-overexposed area and the overexposed area through multi-level adaptive image stretching, and adopts the method of a feathering mask to feather the junction of the non-overexposed area and the overexposed area, ensuring a natural transition of colors at the junction.
[0032] 2. The multi-level adaptive remote sensing image stretching method of the present invention compensates for overexposed ground objects while ensuring that the overall brightness of the stretched image is appropriate, so that the remote sensing image has a better visual perception, while retaining more ground object texture information, realizing the avoidance of overexposure of ground objects during image stretching, improving the display effect of remote sensing images and the function of ground object discrimination, and having the characteristics of multi-level adaptive overexposure compensation and natural color transition at the boundaries of overexposed ground objects. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a schematic flow chart of a multi-level adaptive remote sensing image stretching method of the present invention;
[0034] Figure 2 It is a schematic principle flow chart of a multi-level adaptive remote sensing image stretching method of the present invention;
[0035] Figure 3 It is an example diagram of 4 sub-block images without overexposure compensation using the ordinary stretching method in the embodiment;
[0036] Figure 4 is Figure 3 The corresponding 4 sub-block images in [reference] are example diagrams of overexposure compensation after using the stretching method of the present invention;
[0037] Figure 5 It is a schematic diagram of the structure of the electronic device of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0038] The embodiments of the present invention are described in detail below. The examples of the embodiments are shown in the drawings, in which the same or similar reference signs denote the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below by referring to the drawings are exemplary and are only used to explain the present invention and should not be construed as limiting the present invention.
[0039] In the existing remote sensing images, when stretching and reducing the bit depth from 16 bits to 8 bits, some pixel information will inevitably be lost. The process of discarding larger pixel values usually causes overexposure of highlighted areas in ground objects (such as ground objects like roofs, airplanes, stadiums, etc.), resulting in a poor visual perception and also losing the original details of the ground objects.
[0040] In view of the above problems, the present invention provides a multi-level adaptive remote sensing image stretching method. Figure 1 It is a schematic flow chart of the multi-level adaptive remote sensing image stretching method provided by the embodiment of the present invention. Figure 2 It is a schematic principle flow chart of the multi-level adaptive remote sensing image stretching method provided by the embodiment of the present invention. The method includes:
[0041] S1. Performing an initial level overall stretching on the original image, adjusting the overall appropriate brightness of the image, and obtaining an initial level stretched image.
[0042] Reasonable setting of the initial level percentage cutoff stretching parameters is mainly aimed at ensuring that the overall brightness of the image after initial level stretching is appropriate, without excessively considering the problem of overexposed detailed textures of objects.
[0043] For example, the low ratio truncation parameter can be set to 0.1%, and the high ratio truncation parameter can be set to 99.9%, and 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 truncation low value min, and the value at the N*99.9% position is set to the truncation 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, so as to achieve the initial overall stretching of the original image and obtain the initial level stretched image S1;
[0044] The initial level stretched image S1 is more appropriate in brightness, the main area is not overexposed, and some areas are overexposed. The overexposed areas in the initial level stretched image can be compensated using subsequent sub-level stretched images, so as to ensure that the bright objects are not overexposed while the overall brightness of the image after stretching is appropriate, so as to achieve high-fidelity image stretching of remote sensing images and retain the details and texture of the image.
[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 may be an initial level stretched image S1 or a compensated image S3 by using a threshold segmentation method.
[0047] Take the initial level stretched image S1 as an example: set the threshold of overexposed pixels, the pixels in the stretched image S1 that are smaller than the threshold have a pixel value of 0 on the mask image, and the 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] Take the compensated image S3 as an example: set a threshold for overexposed pixels, and the pixels in the compensated image S3 that are smaller than the threshold have a pixel value of 0 on the mask image, and the 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, creating 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 feathering mask F is initialized with the values of the image mask M, and then the pixels with a value of 0 in the feathering mask F are calculated according to the formula: The formula is:
[0053]
[0054] In the formula, x and y are the image pixel coordinates, r is the feathering radius, and d is the closest distance from the pixel coordinates to the value of 1 in the mask M.
[0055] S4. Perform a sub - level overall stretching on the original image, retain the detailed texture of the over - exposed ground objects in the image, and obtain the sub - level stretched image.
[0056] Reasonably set the percentage truncation stretching parameters of the sub - level, perform an overall stretching on the original image. The main purpose is to retain the detailed texture of the over - exposed ground objects after sub - level stretching. In the present invention, the sub - level stretching is an iterative process.
[0057] The low - ratio truncation parameter of the sub - level is less than that of the upper level, and the high - ratio truncation parameter is greater than that of the upper 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, stretch according to the method in step S1 to obtain the sub - level stretched image S2.
[0058] S5. Perform an overlay operation on the images after the initial level and sub - level overall stretching to obtain a compensated image for the over - exposed area.
[0059] Combine the initial - level stretched image S1(x, y) and the sub - level stretched image S2(x, y) with the feathering mask F to perform an overlay operation to obtain the compensated image S3(x, y) for the over - exposed area. The operation rule is as follows:
[0060] S3(x, y) = S1(x, y) * (1 - F(x, y))+S2(x, y) * F(x, y)
[0061] Among them, in the formula, x and y are the image pixel coordinates.
[0062] S6. Detect the compensated image to determine whether it meets the output conditions.
[0063] Detect the compensated image S3(x, y) after compensation, calculate the percentage of over - exposed pixels in the whole image, that is, count the proportion of pixels exceeding the threshold, and determine whether it meets the set output conditions.
[0064] S7. If it meets the output conditions, the processing is completed and the image is output; if it does not meet the conditions, use the compensated image to repeat steps S2 - S6 until the conditions are met.
[0065] As Figure 3 shown, Figure 3 the four sub - images are the effect images achieved by the ordinary stretching method. The four sub - images have not undergone over - exposure compensation. From the image effect, it can be seen that over - exposure phenomena occur in the highlighted areas of the ground objects (such as rooftops, airplanes, stadiums, etc.), resulting in poor visual perception, and the original details of the ground objects are also lost.
[0066] As Figure 4 shown, Figure 4 the four sub - images are the effect images achieved by the stretching method of the present invention. For the four sub - images, the over - exposure compensation is performed using the method of the present invention. From the image effect, it can be seen that the overall brightness of the stretched image is appropriate. The over - exposed ground objects in Figure 3 are compensated, so that the remote sensing image has a better visual perception and at the same time retains more ground object texture information.
[0067] The multi - level adaptive remote sensing image stretching method of the present invention realizes the determination of the over - exposure compensation area by segmenting the non - over - exposed area and the over - exposed area using an image mask through multi - level adaptive image stretching, and feathering is performed on the junction of the non - over - exposed area and the over - exposed area in the way of a feathered mask, ensuring the natural transition of colors at the junction.
[0068] The present invention also provides an electronic device. Figure 5 is the structural schematic diagram of the electronic device provided by the embodiment of the present invention. As Figure 5 shown, the electronic device may include: a processor, a communications interface, a memory, and a communication bus. Among them, the processor, the communications interface, and the memory complete the communication with each other through the communication bus. The processor can call the logical instructions in the memory, for example, to execute the following method:
[0069] S1. Perform an initial - level overall stretch on the original image, adjust the overall appropriate brightness of the image, and obtain the initial - level stretched image;
[0070] S2. Isolate the over - exposed area in the image and create an image mask for the over - exposed area;
[0071] S3. Create a feathered mask based on the image mask;
[0072] S4. Perform a secondary - level overall stretch on the original image, retain the detailed texture of the ground objects that are prone to over - exposure in the image, and obtain the secondary - level stretched image;
[0073] S5. Perform an overlay operation on the images after the initial - level and secondary - level overall stretches to obtain the compensated image of the over - exposed area;
[0074] S6. Detect the compensated image and determine whether the output condition is satisfied;
[0075] S7. If the output condition is satisfied, the processing is completed and the image is output; if the condition is not satisfied, repeat steps S2 - S6 using the compensated image until the condition is satisfied.
[0076] In addition, when the logical instructions in the above - mentioned memory are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer - readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or a part of this technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read - only memories (ROM, Read - Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0077] The embodiments of the present invention also provide a non - transitory computer - readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is configured to execute the methods provided in the above - mentioned embodiments, for example, including:
[0078] S1. Perform an initial - level overall stretching on the original image to adjust the overall appropriate brightness of the image and obtain an initial - level stretched image;
[0079] S2. Isolate the over - exposed area in the image and create an image mask for the over - exposed area;
[0080] S3. Create a feathering mask based on the image mask;
[0081] S4. Perform a secondary - level overall stretching on the original image to retain the detailed texture of the easily over - exposed features in the image and obtain a secondary - level stretched image;
[0082] S5. Perform a superposition operation on the images after the initial - level and secondary - level overall stretching to obtain a compensated image for the over - exposed area;
[0083] S6. Detect the compensated image and determine whether the output condition is satisfied;
[0084] S7. If the output condition is satisfied, the processing is completed and the image is output; if the condition is not satisfied, repeat steps S2 - S6 using the compensated image until the condition is satisfied.
[0085] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.
[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, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing 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 some 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 them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of each embodiment of the present invention.
Claims
1. A multi-level adaptive remote sensing image stretching method, characterized in that: include: S1, performing an 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, creating 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 level and the overall stretched image of the sub-level to obtain a compensation image of the overexposed area; S6, detecting 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, the compensated image is used to repeat steps S2-S6 until the condition is met.
2. The stretching method according to claim 1, characterized in that The overall stretching of the image 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, characterized in that The step of creating the image mask M in S2 includes: Set the threshold of overexposed pixels, and separate the overexposed area of the stretched image according to the threshold. The pixel value of pixels less than the threshold is 0 on the mask image, and the pixel value of pixels greater than or equal to the threshold is 1 on the mask image.
4. The stretching method according to claim 1, characterized in that: 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 between the pixel coordinate and the 1 value in the image mask M.
5. The stretching method according to claim 1, characterized in that: 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, characterized in that: In S5, a compensation image of the overexposed area is obtained, 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 stretching image, S2(x, y) is the secondary level stretching image, and S3(x, y) is the compensation image.
7. The stretching method according to claim 1, characterized in that: The compensation image is detected in S6 based on calculating the percentage of overexposed pixels in the whole image.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: 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
Mammary gland image enhancement method and device and computer readable storage medium
CN111507912A
Remote sensing image visualization enhancement method based on guiding filtering
CN118967455A
Remote sensing image inter-band registration method based on phase correlation method
CN119379757A