[R] Increasing the resolution of a raster

javad bayat j@b@y@t194 @end|ng |rom gm@||@com
Tue Mar 23 13:14:03 CET 2021


Dear R users;
Is there any way to increase the resolution of a raster so as to be seen
more clear?
I have a raster which is not very clear. I want to read it in R and get its
values and increase the resolution to be seen clearly.
please help me to do this.
I have tried using the following codes, but did not work.

bayat <- raster("./Bayat.jpg")
bayat
class      : RasterLayer
band       : 1  (of  3  bands)
dimensions : 1181, 827, 976687  (nrow, ncol, ncell)
resolution : 1, 1  (x, y)
extent     : 0, 827, 0, 1181  (xmin, xmax, ymin, ymax)
crs        : NA
source     : E:/New/Bayat.jpg
names      : Bayat
values     : 0, 255  (min, max)

bayat2 <- bayat
bayat_value = data.frame(xyFromCell(bayat2, 1:ncell(bayat2)))
valu <- getValues(bayat2)
i <- !is.na(valu)
bayat_value <- bayat_value[i,]
valu <- valu[i]
library(fields)
gc()
tps <- Tps(bayat_value, valu)
bayat3 <- raster(bayat)
bayat3 <- interpolate(bayat3, tps)
bayat3 <- mask(bayat3, bayat)
plot(bayat3)



Sincerely



-- 
Best Regards
Javad Bayat
M.Sc. Environment Engineering
Alternative Mail: bayat194 using yahoo.com

	[[alternative HTML version deleted]]



More information about the R-help mailing list