Instructions
Image standard deviation stretch enhances the contrast of an image by trimming the extreme values and linearly stretching the remaining pixel values. The statistical analysis is performed on the original image data to determine the range of standard deviation. The standard deviation stretch factor is then used to calculate the new range of standard deviation. The pixel values within this range are linearly stretched to fit within the range of [0, 255], reducing the deviation from the average value. The result is returned as a RasterRDD.
Standard deviation: The square root of variance, which reflects the dispersion between individuals within a group. In simple terms, it represents the deviation between most values in the group and the average value. A larger standard deviation indicates greater deviation between most values in the group and the average value. A smaller standard deviation indicates values in the group are closer to the average value.
As shown in the figure below, a pixel value within one standard deviation coefficient accounts for 68%, within two standard deviations accounts for 95%, and within three standard deviations accounts for 99%. If the standard deviation coefficient is defined as 2, pixel values exceeding 2 standard deviations will be pushed to the positions of 0 or 255. Pixel values between two standard deviations are linearly stretched to fit within the range of 0-255. Standard deviation stretch is often used to brighten raster datasets with darker tones.
The histogram below vividly illustrates the process of standard deviation stretch. The left image shows the effect of applying standard deviation stretch on an image, while the right image shows the before and after comparison of the histograms. It can be observed that after stretch, the histogram of the image conforms to the shape of a normal distribution curve, and the standard deviation of the stretched image increases, indicating a decrease in the deviation between the pixel values and the average value.
Standard deviation stretch is frequently used to brighten images with darker tones.
Parameter Specification
Parameter Name | Default Value | Parameter Definition | Parameter Type |
---|---|---|---|
Awaiting analyzed RDD | Awaiting analyzed RasterRDD. | RasterRDD | |
Standard deviation coefficient (Optional) |
2.0 | Standard deviation coefficient, default is 2.0. Pixel values exceeding this standard deviation will be pushed to the maximum or minimum target pixel value, while other data is linearly stretched based on the average value plus or minus this standard deviation as the original extreme value. | Double |
Perform statistics within the function (Optional) |
true | Whether to perform statistics within the function, default is true. When set to false, statistics data will be passed from external sources. | Boolean |
Standard deviations of each band (Optional) |
The standard deviations of each band in the dataset, the length of the array is equal to the number of bands. Only effective when "Perform statistics within the function" is unchecked. This value can be an empirical value for a certain type of data, or it can be obtained through basic statistics or histogram calculation, or it can be directly retrieved from the saved statistics value in the data information. | Object | |
Mean value of each band (Optional) |
The mean values of each band in the dataset, the length of the array is equal to the number of bands. Only effective when "Perform statistics within the function" is unchecked. This value can be an empirical value for a certain type of data, or it can be obtained through basic statistics or histogram calculation, or it can be directly retrieved from the saved statistics value in the data information. | Object | |
Minimum value of each band (Optional) |
The minimum values of each band in the dataset, the length of the array is equal to the number of bands. Only effective when "Perform statistics within the function" is unchecked. This value can be an empirical value for a certain type of data, or it can be obtained through basic statistics or histogram calculation, or it can be directly retrieved from the saved statistics value in the data information. | Object | |
Maximum value of each band (Optional) |
The maximum values of each band in the dataset, the length of the array is equal to the number of bands. Only effective when "Perform statistics within the function" is unchecked. This value can be an empirical value for a certain type of data, or it can be obtained through basic statistics or histogram calculation, or it can be directly retrieved from the saved statistics value in the data information. | Object | |
Minimum target pixel value (Optional) |
0 | The minimum target pixel value. The original pixel values will be stretched to fit within the range of the minimum and maximum target pixel values. Default is 0. | Integer |
Maximum target pixel value (Optional) |
255 | The maximum target pixel value. The original pixel values will be stretched to fit within the range of the minimum and maximum target pixel values. Default is 255. | Integer |