Hi,
I have searched the internet looking for some classical pan-sharpening methods implemented in Python and I have found your repository. I was making some experiments with the PCA-based pan-sharpening, and there is one step in your implementations that generates me some doubts. In lines 70-71 of pansharpen.py you do the following:
P = ( self.pan - self.pan.mean() ) * (np.std(F) / self.pan.std() ) + F.mean()
F[:,:,0] = P
I understand that the idea is replacing the first band in the PCA transformed MS image with the PAN image, after adjusting the PAN image to have the same mean and std_dev than the substituted band.
If that is the cas, shouldn't be the normalisation done in the following way ?
P = ( self.pan - self.pan.mean() ) * (np.std(F[:,:,0]) / self.pan.std() ) + F[:,:,0].mean()
That is, compute the mean and std_dev just from the substituted band (not taking into consideration all band values. Numpy functions mean() and std() flattens arrays by default).
Thanks in advance !!