otbcli_MultivariateAlterationDetector: doc and code are not consistent
In the Multivariate Alteration Detector application, I think there are two issues if the number of bands is different:
- the documentation and the code are not consistent.
The class documentation indicates:
- If numbers of bands in image 1 and 2 are equal, then change maps
- are sorted by increasing correlation. If the number of bands is
- different, the change maps are sorted by decreasing correlation.
When the two images have a different number of bands, the change maps are sorted by decreasing correlation in the function
However, in the
ThreadedGenerateData() function, the change maps order is inverted, then the change maps are sorted by increasing correlation.
This is the same behavior than the matlab code, so there is no difference between the outputs images.
- the correlation vector
m_rhois not consistent with the output image
Compared to the matlab code, the last inversion of the correlation vector
m_rho is missing.
In the matlab code, it is performed at the end of the calculation of the change maps, before inverting the output. Then between OTB and Matlab the
m_rho vector is inverted, leading to an issue of computing change probabilities. By inverting the OTB vector, the issue is solved.
Steps to reproduce
Use both matlab code and OTB MultivariateAlterationDetector application on images with a different number of bands and compare the correlation vectors. I used the Spot5-Gloucester set of images from otb_data.
Ubuntu 14.04, on develop branch build with superbuild.