Skip to content

NDVI (Normalized Difference Vegetation Index) in NIR (near-infrared) orthophotos and VARI (Visible Atmospherically Resistant Index) in RGB orthophotos using libvips image processing library and Python

License

Notifications You must be signed in to change notification settings

dirceu-jr/pyvips-NDVI-and-VARI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyvips NDVI and VARI

How to apply NDVI (Normalized Difference Vegetation Index) in NIR (near-infrared) orthophotos and VARI (Visible Atmospherically Resistant Index) in RGB orthophotos using libvips image processing library and their Python binding.

What is NDVI and VARI?

NDVI and VARI are simple graphical indicators that can be used to analyze remote sensing measurements, assessing whether or not the target being observed contains live green vegetation. It is applied using simple algebra with the bands and in each pixel of an input image.

The NDVI is calculated from these individual measurements as follows: NDVI = (NIR - Red) / (NIR + Red)

And VARI = (Green - Red) / (Green + Red - Blue)

What is libvips?

libvips is a fast and open source image processing library.

Prerequisites

Install libvips and Python. Then use PIP to install 'pyvips' and 'numpy' packages:

pip3 install pyvips
pip3 install numpy

Run

OK? Run the program:

python3 pyvips-vari-ndvi.py nir.png NDVI
python3 pyvips-vari-ndvi.py rgb.png VARI

nir.png and rgb.png orthophoto thumbnails will be processed and resulting ndvi.png and vari.png will be saved.

OBS: The code was made to process images with "alpha" (transparency) layer/band. JPG? Export to PNG before.

Results

RGB → VARI

NIR → NDVI

About

NDVI (Normalized Difference Vegetation Index) in NIR (near-infrared) orthophotos and VARI (Visible Atmospherically Resistant Index) in RGB orthophotos using libvips image processing library and Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages