Description Usage Arguments Details Value Author(s) References Examples
A wrapper function for execute_fitfc_job_cpp
. Intended to execute a single job, that is a number of predictions based on the same input pair(s). It ensures that all of the arguments passed are of the correct type and creates sensible defaults.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
input_filenames |
A string vector containing the filenames of the input images |
input_resolutions |
A string vector containing the resolution-tags (corresponding to the arguments |
input_dates |
An integer vector containing the dates of the input images. |
pred_dates |
An integer vector containing the dates for which images should be predicted. |
pred_filenames |
A string vector containing the filenames for the predicted images. Must match |
pred_area |
(Optional) An integer vector containing parameters in image coordinates for a bounding box which specifies the prediction area. The prediction will only be done in this area. (x_min, y_min, width, height). By default will use the entire area of the first input image. |
winsize |
(Optional) Window size of the rectangle around the current pixel. Default is 51. |
date1 |
(Optional) Set the date of the first input image pair. By default, will use the pair with the lowest date value. |
date3 |
(Optional) For pseudo-doublepair mode: Set the date of the second input image pair. By default, will use the pair with the highest date value. |
n_neighbors |
(Optional) The number of near pixels (including the center) to use in the filtering step (spatial filtering and residual compensation). Default is 10. |
hightag |
(Optional) A string which is used in |
lowtag |
(Optional) A string which is used in |
MASKIMG_options |
(Optional) A string containing information for a mask image (8-bit, boolean, i. e. consists of 0 and 255). "For all input images the pixel values at the locations where the mask is 0 is replaced by the mean value." Example: |
MASKRANGE_options |
(Optional) Specify one or more intervals for valid values. Locations with invalid values will be masked out. Ranges should be given in the format
|
output_masks |
(Optional) Write mask images to disk? Default is "false". |
use_nodata_value |
(Optional) Use the nodata value as invalid range for masking? Default is "true". |
resolution_factor |
(Optional) Scale factor with which the low resolution image has been upscaled. This will be used for cubic interpolation of the residuals. Setting it to 1 will disable it. Default: 30. |
verbose |
(Optional) Print progress updates to console? Default is "true". |
Executes the FITFC Algorithm. If more than one pair is given, will perform prediction for the pred dates twice, once for each of the input pairs.
Nothing. Output files are written to disk. The Geoinformation for the output images is adopted from the first input pair images.
Christof Kaufmann (C++)
Johannes Mast (R)
Wang, Qunming, and Peter M. Atkinson. "Spatio-temporal fusion for daily Sentinel-2 images." Remote Sensing of Environment 204 (2018): 31-42.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# Load required libraries
library(ImageFusion)
library(raster)
# Get filesnames of high resolution images
landsat <- list.files(
system.file("landsat/filled",
package = "ImageFusion"),
".tif",
recursive = TRUE,
full.names = TRUE
)
# Get filesnames of low resolution images
modis <- list.files(
system.file("modis",
package = "ImageFusion"),
".tif",
recursive = TRUE,
full.names = TRUE
)
#Select the first two landsat images
landsat_sel <- landsat[1:2]
#Select some corresponding modis images
modis_sel <- modis[1:12]
# Create output directory in temporary folder
out_dir <- file.path(tempdir(),"Outputs")
if(!dir.exists(out_dir)) dir.create(out_dir, recursive = TRUE)
#Run the job, fusing two images
fitfc_job(input_filenames = c(landsat_sel,modis_sel),
input_resolutions = c("high","high",
"low","low","low",
"low","low","low",
"low","low","low",
"low","low","low"),
input_dates = c(68,77,68,69,70,71,72,73,74,75,76,77,78,79),
pred_dates = c(71,79),
pred_filenames = c(file.path(out_dir,"fitfc_71.tif"),
file.path(out_dir,"fitfc_79.tif"))
)
# remove the output directory
unlink(out_dir,recursive = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.