光谱数据平滑使用SNV和MSC

huangapple go评论130阅读模式
英文:

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 &lt;- data[, 1:204]
means &lt;- apply(spectra, 2, mean)
sds &lt;- apply(spectra, 2, sd)
data_snv &lt;- scale(spectra, center = means, scale = sds)

For MSC:

average_spectrum &lt;- apply(spectra, 2, mean)
corrected_spectra &lt;- sweep(spectra, 2, average_spectrum, FUN = &quot;-&quot;)

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 &lt;- standardNormalVariate(X = spectra)
msc_spc &lt;- msc(X = spectra)

huangapple
  • 本文由 发表于 2023年6月19日 12:48:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76503668.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定