Perform a mosaic of input images
This application performs a mosaic of the input images
This application has several output images and supports “multi-writing”. Instead of computing and writing each image independently, the streamed image blocks are written in a synchronous way for each output. The output images will be computed strip by strip, using the available RAM to compute the strip size, and a user defined streaming mode can be specified using the streaming extended filenames (type, mode and value). Note that multi-writing can be disabled using the multi-write extended filename option: &multiwrite=false, in this case the output images will be written one by one. Note that multi-writing is not supported for MPI writers.
-il image1 image2... Mandatory
Input images to mosaic
Input VectorData for composition
-vdcut vectorfile1 vectorfile2...
VectorData files to be used for cut input images. Must be provided in the same order as the input images.
Input VectorData for statistics
-vdstats vectorfile1 vectorfile2...
VectorData files to be used for statistics computation (harmonization). Must be provided in the same order as the input images.
This group of parameters sets the mosaic compositing
-comp.feather [none|large|slim] Default value: none
Set the feathering method for composition
- Simple compositing method
No feathering method is used. Copies the last image over earlier ones in areas of overlap
- The large blending composition mode
Blends all images on the maximum overlapping areas (this produces seamless mosaics, but can cause blur effect where images are not perfectly aligned)
- The slim blending composition mode
Blends the last image over earlier ones in areas of overlap, on a given transition distance (seam can be visible from a certain zoom level, but it does not cause blur effect when images are not perfectly aligned)
Transition smoothness (1.0 = linear transition)
-comp.feather.slim.exponent float Default value: 1
Transition length (In cartographic units)
This group of parameters enables to set the mosaic harmonization method
-harmo.method [none|band|rgb] Default value: none
Set the harmonization method. More information about the “band” and “rgb” methods can be found in the paper “Natural Color Satellite Image Mosaicking Using Quadratic Programming in Decorrelated Color Space” Cresson and Saint-Geours, July 2015, IEEE JSTARS Volume 8 Issue 8 (https://doi.org/10.1109/JSTARS.2015.2449233)
No automatic harmonization is done
- Spectral bands
Consists in minimizing a cost function based on images statistics in overlapping areas, for each band independently
- True colors
Consists in minimizing a cost function based on images statistics in overlapping areas, in a decorreleted color space suitable for true color processing (works only on true color images, i.e. RGB). Only the first 3 bands are processed by this method.
harmonization cost function
-harmo.cost [rmse|musig|mu] Default value: rmse
Set the harmonization cost function
- Root mean squared error based cost function
- Mean and Standard deviation based cost function
- Mean based cost function
-out image [dtype] Mandatory
Output image, resulting from the mosaicing process.
-interpolator [nn|bco|linear] Default value: nn
This group of parameters allows defining how the input image will be interpolated during resampling.
- Nearest Neighbor interpolation
Nearest neighbor interpolation leads to poor image quality, but it is fast.
- Bicubic interpolation
Bicubic interpolation leads to great image quality, but it is slow.
- Linear interpolation
Linear interpolation leads to average image quality but is quite fast
Radius for bicubic interpolation
-interpolator.bco.radius int Default value: 2
Size of the bicubic interpolation filter. If the target pixel size is higher than the input pixel size, increasing this parameter will reduce aliasing artefacts.
Output mosaic pixel grid parameters
Pixel Size (X)
Physical size (X) of output image pixels, in cartographic units.
Pixel Size (Y)
Physical size (Y) of output image pixels, in cartographic units..
Directory for temporary files
Directory for temporary files. If not set, the output image parent directory is used.
Distance maps sampling ratio
-distancemap.sr float Default value: 10
Distance maps are computed when the compositing method uses feathering. The distance maps sampling ratio is the ratio between the distance map physical spacing and the physical spacing of the original image. It is used to change the distance maps physical spacing: since the distance map computation is not a streamable pipeline, it can be useful to compute slightly smaller distance maps. distancemap.sr can be hence increased if input images are too big to fit the RAM, or in order to speed up the process
-nodata float Default value: 0
The no-data value is ignored during statistics computations (for color harmonisation) and for the mosaic compositing.
Available RAM (MB)
-ram int Default value: 256
Available memory for processing (in MB).
From the command-line:
otbcli_Mosaic -il SP67_FR_subset_1.tif SP67_FR_subset_2.tif -out mosaicImage.tif
import otbApplication app = otbApplication.Registry.CreateApplication("Mosaic") app.SetParameterStringList("il", ['SP67_FR_subset_1.tif', 'SP67_FR_subset_2.tif']) app.SetParameterString("out", "mosaicImage.tif") app.ExecuteAndWriteOutput()
- When “comp” parameter is different than “none”, the sampling ratio for distance map computation can be adjusted to make input images fit into memory (distance map computation is not streamable).2. When “harmo” method is not “none”, an algorithm performs the color harmonization of the input images using quadratic programming (QP). The objective function of the QP is a set of matrices, each one with size NxN (N being the number of input images). Hence, a large number of input images imply that those matrices fit into memory, and this is not related to the streaming capability of the application (ram parameter) but intrinsic to the harmonization process.