Mosaic¶
Perform a mosaic of input images
Description¶
This application performs a mosaic of the input images
Parameters¶
Input Images -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.
Mosaic compositing mode¶
This group of parameters sets the mosaic compositing
Feathering method -comp.feather [none|large|slim]
Default value: none
Set the feathering method for composition
- The simplest composition mode
No feathering method is used. Images are stacked in overlaps - The large blending composition mode
Blends all images on the maximum overlapping areas. May generate blur when inputs are not well aligned - The slim blending composition mode
Blends the last image over earlier ones in areas of overlap, on a given transition distance
The slim blending composition mode options¶
Transition smoothness (1.0 = linear transition) -comp.feather.slim.exponent float
Default value: 1
Transition length (In cartographic units) -comp.feather.slim.lenght float
Spectral bands harmonization mode¶
This group of parameters tunes the mosaic harmonization
harmonization method -harmo.method [none|band|rgb]
Default value: none
Set the harmonization method
- None
No automatic harmonization is done - Spectral bands
Automatic harmonization is performed on each individual spectral band - True colors
Works on RGB colors only. Use an harmonization method based on quadratic programming in LAB color space
harmonization cost function -harmo.cost [rmse|musig|mu]
Default value: rmse
Set the harmonization cost function
- RMSE based
- Mean+Std based
- Mean based
Output image -out image [dtype]
Mandatory
Output image, resulting from the mosaicing process.
Interpolation -interpolator [nn|bco|linear]
Default value: nn
This group of parameters allows to define 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
Bicubic interpolation options¶
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 Image Grid¶
Output mosaic pixel grid parameters
Pixel Size (X) -output.spacingx float
Physical size (X) of output image pixels, in cartographic units.
Pixel Size (Y) -output.spacingy float
Physical size (Y) of output image pixels, in cartographic units..
Directory for temporary files -tmpdir directory
Directory for temporary files. If not set, the output image parent directory is used.
Distance maps computation¶
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
no-data value -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).
Examples¶
From the command-line:
otbcli_Mosaic -il SP67_FR_subset_1.tif SP67_FR_subset_2.tif -out mosaicImage.tif
From Python:
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()
Limitations¶
- 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.