Package: homonim
homonimCorrect aerial and satellite imagery to surface reflectance.Descriptionhomonimprovides a command line interface and API for correcting remotely sensed imagery to approximate surface reflectance.  It implements a form ofspectral harmonisation, that adjusts for spatially varying atmospheric and anisotropic (BRDF) effects, byfusionwith satellite surface reflectance data.  Manual reflectance measurements and target placements are not required.homonimis useful for pre-processing in quantitative mapping applications, and for reducing seamlines and other visual artefacts in image mosaics.  It can be applied to multi-spectral drone, aerial and satellite imagery.  The consistency of multi-temporal and multi-sensor data can improved through its use.See the documentation site for more detail:https://homonim.readthedocs.io/.Installationhomonimis available as a python 3 package, viapiporconda.pippipinstallhomonimcondacondainstall-cconda-forgehomonimGetting startedCommand line interfacehomonimcommand line functionality is accessed through the commands:fuse: Correct image(s) to surface reflectance.compare: Compare image(s) with a reference.stats: Report parameter statistics.Get help onhomonimwith:homonim--helpand help on ahomonimcommand with:homonim<command>--helpExamplesCorrectsource.tifto surface reflectance by fusion withreference.tif, using the default settings:homonimfusesource.tifreference.tifCorrect images matchingsource*.tifto surface reflectance by fusion withreference.tif.  Use a 5 x 5 pixel kernel and thegain-blk-offsetmodel for correction, and place corrected images in the./correcteddirectory:homonimfuse-k55-mgain-blk-offset-od./correctedsource*.tifreference.tifStatistically comparesource.tifandcorrected.tifwithreference.tif.homonimcomparesource.tifcorrected.tifreference.tifAPIExampleSurface reflectance correction of an aerial image using a Sentinel-2 reference.frompathlibimportPathfromhomonimimportRasterFuse,RasterCompare,Model# urls of source and reference test imagessrc_file=('https://raw.githubusercontent.com/leftfield-geospatial/homonim/main/''tests/data/source/ngi_rgb_byte_1.tif')ref_file=('https://raw.githubusercontent.com/leftfield-geospatial/homonim/main/''tests/data/reference/sentinel2_b432_byte.tif')# path to corrected file to createcorr_file='./corrected.tif'# Correct src_file to surface reflectance by fusion with ref_file, using the# `gain-blk-offset` model and a kernel of 5 x 5 pixels.withRasterFuse(src_file,ref_file)asfuse:fuse.process(corr_file,Model.gain_blk_offset,(5,5),overwrite=True)Reference imagerygeedimcan be used as a companion tool for searching and downloading cloud-free reference imagery.   Alternatively, satellite imagery is available from a number of sources, including theGoogle,AmazonandMicrosoftrepositories.UsageSee the documentationhere.Terminologyhomonimis shorthand forhomogenise imageand is a reference tothe paperon which it is based.Creditshomonimrelies on these excellent packages:rasterioopencvnumpyLicensehomonimis licensed under the terms of theAGPLv3. This project is developed in collaboration withInnovUSat Stellenbosch University, alternative licenses can be arranged bycontactingthem.CitationPlease cite use of the code as:Dugal Harris & Adriaan Van Niekerk (2019) Radiometric homogenisation of aerial images by calibrating with satellite data,International Journal of Remote Sensing,40:7, 2623-2647, DOI:https://doi.org/10.1080/01431161.2018.1528404.Bibtex:@article{doi:10.1080/01431161.2018.1528404,
    author = {Dugal Harris and Adriaan Van Niekerk},
    title = {Radiometric homogenisation of aerial images by calibrating with satellite data},
    journal = {International Journal of Remote Sensing},
    volume = {40},
    number = {7},
    pages = {2623-2647},
    year  = {2019},
    publisher = {Taylor & Francis},
    doi = {10.1080/01431161.2018.1528404},
    URL = {https://doi.org/10.1080/01431161.2018.1528404},
}