build.gaus构建二维高斯图像(矩阵),R语言imagefx包,时序图像特征识别
# Wed Sep 15 15:28:30 2021 -
# 字符编码:UTF-8
# R 版本:R x64 4.1.1 for window 11
# [email protected]
# 个人笔记不负责任,拎了个梨
#.rs.restartR()
require(imagefx)
rm(list = ls());gc()
? build.gaus # 构建二维高斯图像(矩阵)
#构建矩阵 Wed Sep 15 15:31:59 2021 ------------------------------
xdim=101
ydim=101
# x方向的sigma。如果未提供,y西格玛默认为sig.x
sig.x=5
gaus1 <- build.gaus(xdim,ydim,sig.x)
heatmap(gaus1)
image(gaus1)
dev.copy(png, "build.gaus构建二维高斯图像(矩阵).png");dev.off()
image(1:nrow(gaus1),1:ncol(gaus1),useRaster=TRUE,gaus1)
#ex2 Wed Sep 15 15:37:10 2021 ------------------------------
xdim=101
ydim=201
sig.y=5
sig.y=20
## define the center (peak) location of the guassian
x.mid = 30
y.mid = 120
## now build the gaussian
gaus2 <- build.gaus(xdim,ydim,sig.x,sig.y,x.mid,y.mid)
heatmap(gaus2)
dev.copy(png, "build.gaus构建二维高斯图像(矩阵)2.png");dev.off()
gaus2 |> image()
dev.copy(png, "build.gaus构建二维高斯图像(矩阵)3.png");dev.off()
image(1:nrow(gaus2),1:ncol(gaus2),useRaster=TRUE,gaus2)
#end Wed Sep 15 15:38:40 2021 --