How to display a radar image, so that it is not too ugly?
The dynamics of SAR images are enormous. For this reason, we usually convert them into decibels. But this is not the best practice for displaying an eye-pleasing image.
Let’s consider an “SLC” radar image, i.e. stored in the form of complex numbers. We will assume that we know how to open an image and convert it into an array or matrix of pixels containing complex values, noted Z.
The notion of amplitude is relative to the modulus of this complex number: A=|Z|. Note that this amplitude is “physically” relative to the amplitude of an electric field.
The notion of intensity is relative to the square of the amplitude, thus to the square of the modulus of this complex number: I=|Z|². Note that this intensity is “physically” relative to an electrical power.
The phase appears to be uniformly distributed between -π and π.
The following example is based on an extract of a TerraSAR-X image, acquired over the city of Toulouse, France (The TanDEM-X data were provided by DLR under the scientific proposal OTHER0103)
I propose some very simplistic lines in Python. Let’s imagine for example that your image is stored as a numpy array of complexes, in the variable Z.
The following code:
import matplotlib.pylab as plt
import numpy as npplt.figure(figsize=(6,6))
plt.imshow(np.abs(Z),cmap='gray')
will display:
That’s pretty disappointing, isn’t it?
Since we are used to converting radar signals to dB (decibels), this is the same as converting the image to a logarithmic base. We can therefore imagine displaying our image directly in logarithmic scale. But generally, this makes the contrasts bland. Here is the display for our same example of the previous Z matrix, converted into dB using the formula 20 log₁₀ ( |Z|) :
plt.imshow(20*np.log10(np.abs(Z)),cmap='gray')
From my experience, it is much better to continue working in linear amplitude scale, and to apply a threshold before displaying the image.
To calculate this threshold, we can start from the statistics of the image to choose a classical threshold of m+σ, or m + 3 σ, where m is the mean, and σ is the standard deviation of signal, estimated on the whole image. But to do this, we must calculate these statistical parameters on the images in amplitude, not intensity.
For example, here is the approach taken on the intensity image:
I=np.abs(Z)**2
Im=np.mean(I)
Is=np.std(np.abs(I))plt.figure(figsize=(4,4))
plt.imshow(np.abs(I),cmap='gray',vmin=0,vmax=Im+Is)
We begin to see details, but it is still not very satisfactory. On the other hand, here is the same image displayed and thresholded in amplitude:
A=np.abs(Z)
Am=np.mean(A)
As=np.std(np.abs(A))plt.figure(figsize=(4,4))
plt.imshow(np.abs(A),cmap='gray',vmin=0,vmax=Am+As)
I am sure that the people of Toulouse can start -at last- to recognize things. A hint: the Onera Toulouse center is inside this image.
However, this threshold should only be applied for visualization purposes! They should not be sacrificed for further processing. Valuable information can be found in the extremes of the distribution. Note that at the start of the Google Earth Engine platform, the images of the Sentinel-1 collection were quantified linearly, after thresholding on the extreme percentiles which were considered as “outliers”. A few years later, following the numerous feedbacks from researchers, the developers made the choice to start again from the original data to offer a collection without this thresholding, because it was catastrophic for some information or further processing!
Bottom line:
● Even if the calibrated SAR signals are proportional to an intensity or power, it is preferable, for the purposes of displaying SLC images, to work in linear scale of thresholded amplitudes.
● This thresholding should not be applied for further processing that exploits speckle statistics.