Dimensionality Reduction: more problems with the -bv option
Description
Results of two images that are identical except that nodata is coded with different values produce different results despite adjusting the -bv parameter
Steps to reproduce
otbcli_DimensionalityReduction.bat -in mini1.tif -out mini1PCAotbnowhit.tif uint8 -method pca -method.pca.whiten false -rescale minmax -rescale.minmax.outmin 1 -rescale.minmax.outmax 255 -nbcomp 5 -ram 256 -method.pca.outeigenvalues mini1PCAotbnowhit.eig.csv -outmatrix mini1PCAotbnowhit.eigmat.csv -bv 0
otbcli_DimensionalityReduction.bat -in mini2.tif -out mini2PCAotbnowhit.tif uint8 -method pca -method.pca.whiten false -rescale minmax -rescale.minmax.outmin 1 -rescale.minmax.outmax 255 -nbcomp 5 -ram 256 -method.pca.outeigenvalues mini2PCAotbnowhit.eig.csv -outmatrix mini2PCAotbnowhit.eigmat.csv -bv -9999
min1.tif and mini2.tif are identical except that nodata are differently coded: 0 in mini1.tif and -9999 in mini2.tif
mini1.tif
mini2.tif
outmatrix from mini1.tif:
0.0225902 0.13464175 0.03616559 0.38740169 0.911028686
-0.2931714 -0.39771676 -0.61992474 -0.52302445 0.313066519
-0.2664791 -0.07863263 -0.57043029 0.72516423 -0.267491959
0.1835331 -0.90372588 0.31428125 0.22444948 0.021091448
0.8993579 0.02809663 -0.43614442 -0.01116367 -0.004392191
outmatrix from mini2.tif:
0.264344642 0.56605767 0.4501535 0.441180578 0.4608928
0.437861248 -0.01381594 0.2648024 -0.810937410 0.2834553
0.826028376 0.06059065 -0.3429448 0.193662447 -0.3986096
-0.236645417 0.82023511 -0.2316503 -0.331929794 -0.3276798
0.008689483 0.05413842 -0.7456330 -0.007594959 0.6640537
Eigenvectors calculated in R are identical for both images
and very close to those of otb for mini1.tif
(note R arranges eigenvectors by columns)
0.02172112 0.2969163 0.26230709 0.269461355 0.877470509
0.13260990 0.4015052 0.03351642 -0.896746212 0.126218499
0.03314596 0.6279545 0.57752377 0.242825808 -0.460517598
0.38654206 0.5127257 -0.72212125 0.253401650 -0.045012501
0.91182750 -0.3056467 0.27400516 0.007748542 -0.003436984
Finally, PCA images are quite different even the resulting from mini1.tif vs. the one calculated in R
mini1PCARint.tif
mini1PCAotbnowhit.tif
mini2PCAotbnowhit.tif
Configuration information
OTB-7.1.0-rc1-Win64