Skip to content

JavierLopatin/Python-Remote-Sensing-Scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python-Remote-Sensing-Scripts

A set of python scripts for remote sensing processing. All functions were created using Python 3.6

As an example, I will use a UAV-based hyperspectral image of a peatland in central-south Chile. The image have 41 bands (10 nm width) ranging form 480-880 nm and a pixel size of 10 cm. The green dots correspond to plots where measurements of biomass, species composition and carbon stock information were taken:

alt text

With our scripts you can first extract the spectra in the plots location in a few seconds

python ExtractValues.py -r peatland.tif -s plots.shp -i ID

Check out the output

N B1 B2 B3 B4 B5 B6 B7 B8 B9 ... B32 B33 B34 B35 B36 B37 B38 B39 B40 B41
0 1.0 1509.813451 2291.564899 3109.637130 3962.194325 4674.092289 5177.553225 5526.183572 5698.716701 5730.444486 ... 15122.021006 15696.353105 15488.906034 15259.373692 15370.818661 15988.557692 16801.212295 16728.998597 16846.117603 17324.593108
1 2.0 1708.011608 2617.267914 3579.341584 4624.986406 5542.596761 6221.865500 6708.542956 6970.212103 7036.433086 ... 20393.572983 20991.396063 20751.881674 20494.922936 20547.978802 21333.448745 21717.872021 21661.447804 21420.735874 21518.602349
2 3.0 12.875854 211.439792 1201.264700 2444.936965 3603.781002 4468.655196 5054.639060 5373.096807 5479.100261 ... 40287.680262 40283.248111 39078.153197 37895.060076 38651.953385 39584.352791 40869.073804 39726.095768 39378.668239 37695.083542
3 4.0 214.950019 852.952500 1827.763722 2946.394303 3962.429581 4700.627478 5189.396823 5428.162923 5479.461922 ... 16865.061517 17382.712572 17022.812516 16595.132046 16618.242789 17052.205065 17653.929336 17440.521948 17410.552106 17704.214614
4 5.0 2704.663992 3474.524823 4291.852040 5139.117787 5834.414719 6324.879534 6673.001772 6841.418896 6859.041616 ... 19038.206233 19714.628088 19361.587963 19008.547838 19256.278283 20024.457928 20623.883552 20655.435636 20865.324231 20861.972693

You can also perform a MNF transformation of the data. This function have several options, like applying Savitzky Golay filtering and brightness normalization of the spectra. The basic function is like (image resample to 2m in the example):

python MNF.py -i peatland.tif

alt text

Get the Gray-Level Co-Occurrence Matrix (GLCM) textures from an image. Here, we used the first MNF component as raster imput with a moving window of 5 X 5 pixels (default):

python GLCM.py -i peatland_MNF.tif

alt text

Finally, we can also obtain texture information from point clouds (in this case based in the UAV photogrametric point cloud) based on the Canupo algorithm proposed by This paper, which is also implemented in the CloudCompare LiDAR software. Nevertheless, both the paper and the software implement the transformation to generate poin-based classification while this python script produces texture rasters to be use in any application:

python canupo.py -i lidar.txt -s 1 5 1 -r 1
# scales: 1,2,3,4,5 m; output resolution 1 m

alt text

About

Python 3.X scripts for remote sensing processing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages