ssim_raster | R Documentation |
This function calculates the SSIM, a measure of similarity between two raster images
ssim_raster(img1, img2, global = TRUE, w = 3, k1 = NULL, k2 = NULL)
img1 |
A |
img2 |
A |
global |
If global is TRUE, returning the global average of SSIM, SIM, SIV, and SIP. If the option is FALSE, a |
w |
Integer specifying the window size for the local neighborhood. Default is 3. |
k1 |
The constant used in the SSIM calculation. Default is NULL, in which case it is computed from the maximum value of the images. |
k2 |
The constant used in the SSIM calculation. Default is NULL, in which case it is computed from the maximum value of the images. |
This function computes the SSIM index for two raster images.
If global is TRUE, returning the global average of SSIM, SIM, SIV, and SIP. If the option is FALSE, a terra
raster brick containing the SSIM, SIM, SIV, and SIP for each cell is returned.
single<-system.file("/ex/single2nm.tif", package="SSIMmap")
group<-system.file("/ex/groups2nm.tif", package="SSIMmap")
whale_single<-terra::rast(single)
whale_groups<-terra::rast(group)
ssim_raster(whale_single,whale_groups)
result_raster<-ssim_raster(whale_single,whale_groups,global=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.