英文:
Spectral data smoothing using SNV and MSC
问题
我正在尝试过滤高光谱数据。我有204个光谱波段。我尝试使用以下代码对标准正态变量 (SNV) 和多重散射校正 (MSC) 进行处理。
对于SNV:
spectra <- data[, 1:204]
means <- apply(spectra, 2, mean)
sds <- apply(spectra, 2, sd)
data_snv <- scale(spectra, center = means, scale = sds)
对于MSC:
average_spectrum <- apply(spectra, 2, mean)
corrected_spectra <- sweep(spectra, 2, average_spectrum, FUN = "-")
想要确认这些是否正确吗?
尝试使用这些代码但不确定。
英文:
I am trying to filter the hyperspectral data. I have 204 spectral bands. I tried R for the standard normal variate (SNV) and multiple scattering correction (MSC) using the following codes.
For SNV:
spectra <- data[, 1:204]
means <- apply(spectra, 2, mean)
sds <- apply(spectra, 2, sd)
data_snv <- scale(spectra, center = means, scale = sds)
For MSC:
average_spectrum <- apply(spectra, 2, mean)
corrected_spectra <- sweep(spectra, 2, average_spectrum, FUN = "-")
Want to confirm whether these are correct or not?
Tried using these codes but not sure.
答案1
得分: 0
你可以使用 prospectr
包来执行所有这些操作,例如:
library(prospectr)
snv_spc <- standardNormalVariate(X = spectra)
msc_spc <- msc(X = spectra)
英文:
You can use prospectr
package to do all these like
library(prospectr)
snv_spc <- standardNormalVariate(X = spectra)
msc_spc <- msc(X = spectra)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论