# RSB: Robust Successive Binarization for Change Detection in Bitemporal Hyperspectral Images
## 2 Methodology
### The Algorithm  
For the bi-temporal pair of HS images \((I_{1},I_{2})\), the generation of the final binary change map is carried out by using the following _robust successive binarization_ (RSB) procedure:  
1. Application of an error function \(f_{i}\), which gives as output an image denoted by \(\widetilde{I}_{i}\), for every \(i=1,\dots,6\), line 2 in Algorithm 1. 2. Scaling in the range \([0,1]\) the intensity values of \(\widetilde{I}_{i}\), to obtain \(\widetilde{I}_{i,s}\), line 3 in Algorithm 1. 3. Binarize \(\widetilde{I}_{i,s}\) by applying different threshold values, line 3 in Algorithms 1 and 2. In particular, let us denote with \(\varepsilon=0.2,0.3,0.4,0.5,0.6\) the chosen thresholds. The pixels in \(\widetilde{I}_{i,s}\) are screened against the values of \(\varepsilon\), producing 5 differently binarized images, for every analyzed \(\widetilde{I}_{i,s}\). Hence, selecting any \(\widetilde{I}_{i,s}\), the pixels greater than or equal to the value of the current \(\varepsilon\) are set to 1 (i.e., they will be white), and the others, less than \(\varepsilon\), will be set to 0, i.e., black pixels. We denote the resulting image with \(\widetilde{I}_{i,s,\varepsilon}\), for the chosen value of \(\varepsilon\). The computational cost for this procedure is \(O(5p+5)\). It should be noted that this process is commonly performed by an automatic thresholding technique, such as [PERSON]'s thresholding method; see [34]. The choice to produce 5 different outputs though is preferable here, as we are not seeking to produce the best binarized possible image, for which an adapting thresholding technique should be employed. The goal here is to produce a set of different possible binary images, which is achieved more easily in the following. 4. A suitable mean image is then computed as \[M_{i}=\frac{\sum_{\varepsilon}\widetilde{I}_{i,s,\varepsilon}}{2}.\]  
The choice to divide by 2 rather than by 5, as it would be in the common mean definition, is motivated by the fact that we are looking to sum together the contributions of the two sought classes of changed and unchanged pixels. Since it is not a priori known which of the 5 produced binary images are the best ones to make the two classes fairly separable, all \(\widetilde{I}_{i,s,\varepsilon}\) are considered, but it is assumed that the contribution provided by these 5 images, under a theoretical point of view, should sum up to 2. 5. Every image \(M_{i}\), for \(i=1,\dots,6\), is then itself binarized (line 5 in Algorithms 1 and 3) by setting to 1, i.e., white, the pixels whose intensity is greater than or equal to 1, and setting to 0, i.e., black, the pixels with intensity values less than 1. The computational cost for this procedure is \(O(p)\). This step, for every fixed \(i\), will produce an image denoted with \(M_{i,b}\) whose entries are only integer values of 0 s and 1 s.
6. The next step consists in computing the following image: \[T=\sum_{i=1}^{6}M_{i,b}.\]
7. Since \(T\) is obtained by summing integer quantities, when the white pixels are present on the same areas, the resulting entries in \(T\) will be equal to 6; on the contrary, if only black pixels are present in a certain spot, the corresponding entries in \(T\) will be 0. An interesting case arises when, on the same regions, in some cases, there are white pixels, and in other cases, there are black ones. In particular, \(T\) is binarized according to the following rule: * Pixels with an intensity value greater than or equal to 3 are set to 1 and hence will be white, i.e., changed ones;* Pixels with values less than 3 are set to 0, and hence they will denote unchanged areas. This procedure is summarized in Algorithm 4 and it costs \(O(p)\). The adopted error functions are dissimilarity measures; hence, the higher values are provided when different areas, either in the spatial domain or in the spectral domain, are analyzed.