Giter Site home page Giter Site logo

tmask-algorithm's Introduction

tmask-algorithm Tmask software The 1.0 version of Tmask will be ready to use soon! Able to process Landsat 4, 5, 7, and 8 images on Windows and Linux server.

Please cite the following paper: Zhu, Z. and Woodcock, C. E., Automated cloud, cloud shadow, and snow detection based on multitemporal Landsat data: an algorithm designed specifically for monitoring land cover change, Remote Sensing of Environment (accepted), doi:10.1016/j.rse.2014.06.012 (This paper explains the 1.0 version of Tmask in great details).

Please note that this algorithm is very time consuming. For example, to provide cloud, cloud shadow, and snow masks for all sample images (33 Landsat images), it may take approximately 20 CPU hours! Running on the high performance computing server is suggested.

This Matlab code called Tmask (multiTemporal mask) is used for automated clouds, cloud shadows, and snow masking for Landsat images based on time series analysis developed by Zhe Zhu ([email protected]) and Curtis E. Woodcock ([email protected]) at Center for Remote Sensing, Department of Earth and Environment, Boston University.

After running Fmask, there will be an image called XXXTmask that can be opened by ENVI. The image values are presenting the following classes:

0 => clear land pixel

1 => clear water pixel

2 => cloud shadow

3 => snow

4 => cloud

255 => no observation

1.0 Stand Alone Version This algorithm provide better results than Fmask and is based on the Fmask results and time series analysis.

Before using this Tmask algorithm, there are many works need to be done. First, you need to convert the three Landsat bands (Band 2, 4, and 5 - Landsat 7 numbering) into TOA reflectance. Second, you need to run Fmask algorithm for each Landsat images. Third, you need to stack the three TOA bands and Fmask band together into the same biq image file (ENVI format) in the ordering of TOA Band 2, 4, 5, and Fmask result. Fourth, put each stack file and original metadata into the same folder (each folder contain one Landsat images). Finally, resample all the stacked images into the same dimension and same upper-left corner (make images comparable) as the first image. Then you are able to run Tmask for as many images as you want.

There are some sample stacked data prepared for Tmask algorithm located at: http://ftp-earth.bu.edu/public/zhuzhe/Tmask/data/

Matlab code Need Matlab environment and toolboxes and can be run on any 64bits machine (PC, Mac, Linux) with 4G+ memory.

You can download the Matlab code here: https://www.dropbox.com/sh/4qjcihruku5bou6/AAAEdsQUdzirVFmyEqpkZLRsa?dl=0

Linux Executable Stand alone Linux executable Fmask software which do not need to install Matlab or R and runs on Linux 64 bits machine with 4G+ memory. Please use the following steps:

  1. Download Tmask 1.0 version Linux package "Tmask_pkg.zip" Use any Brosweer and go to the following ftp sites: http://ftp-earth.bu.edu/public/zhuzhe/Tmask/Tmask_Linux_1.0v/

  2. Unzip the software using "unzip Tmask_pkg.zip"

  3. There will be a new file called MCRInstaller.zip at the same folder and unzip this file.

  4. Install MCRInstaller by typing "./install" in the same folder

  5. There will be wizard that help you install and there will be two environment variables called "LD_LIBRARY_PATH" and "XAPPLRESDIR" showed up in the wizard. Copy the two variables.

For example, This is what I got:

"On the target computer, append the following to your LD_LIBRARY_PATH environment variable:

/home/amd64

Next, set the XAPPLRESDIR environment variable to the following value:

/home/app-defaults"

  1. Edit your .cshrc (.tcsh is the same, for .bash replace it with export LD_LIBRARY_PATH="...") file and add this

"setenv LD_LIBRARY_PATH /home/amd64"

"setenv XAPPLRESDIR /home/app-defaults"

  1. Save the shell or bash script and source it;

  2. Copy the "Tmask" software to any location you want (for example "/Tools/Tmask");

  3. cd into the folder where all the folders of Landsat data are stored and run Tmask by entering "/Tools/Tmask stk_n" in the terminals. Wait a few seconds you will be able to see both robust fit percent and Tmasking.

There are 7 important tuning variables that you can play with:

  1. "stk_n" is the stack image file name (such as "TOAstack").

  2. "n_start" is the number of the first image you want to have Tmask processed (default value of 1).

  3. "n_end" is the number of the last image you want to have Tmask processed (default value of the total number of folders with name start as L)

  4. "T_times" is the threshold used for detecting cloud, cloud shadow, and snow (default value of 400).

  5. "bufcd" is buffered number of pixels for cloud (default value of 3).

  6. "bufsd" is buffered number of pixels for cloud shadow (default value of 3).

  7. "bufsn" is buffered number of pixels for snow (default value of 0).

You can use "/Tools/Tmask stk_n n_start n_end T_times bufcd bufsd bufsn", for example "/Tools/Tmask TOAstack 1 33 400 3 3 0" in the terminals. Or if you want to use default values, you can use "/Tools/Tmask stk_n n_start n_end T_times", or "/Tools/Tmask stk_n n_start n_end", or "/Tools/Tmask stk_n".

Windows Executable Stand alone Linux executable Tmask software which do not need to install Matlab or R and runs on Linux 64 bits machine with 4G+ memory. Please use the following steps:

  1. Download Tmask 1.0 version Windows package "Tmask_pkg.exe" Use any Brosweer and go to the following ftp sites: http://ftp-earth.bu.edu/public/zhuzhe/Tmask/Tmask_Windows_1.0v/

  2. Double click "Tmask_pkg.exe" and install it with wizard.

  3. There will be a new file called "Tmask.exe" at the same folder and this is your Tmask software

  4. Copy the "Tmask.exe" software to any location you want (for example "c:\Tools");

  5. In the Command Prompt Window (enter cmd in the start menu), cd into the folder where all the folders of Landsat data are stored and run Tmask by entering "c:\Tools\Tmask stk_n". Wait a few seconds you will be able to see both robust fit percent and Tmasking.

There are 7 important tuning variables that you can play with:

  1. "stk_n" is the stack image file name (such as "TOAstack").

  2. "n_start" is the number of the first image you want to have Tmask processed (default value of 1).

  3. "n_end" is the number of the last image you want to have Tmask processed (default value of the total number of folders with name start as L)

  4. "T_times" is the threshold used for detecting cloud, cloud shadow, and snow (default value of 400).

  5. "bufcd" is buffered number of pixels for cloud (default value of 3).

  6. "bufsd" is buffered number of pixels for cloud shadow (default value of 3).

  7. "bufsn" is buffered number of pixels for snow (default value of 0).

You can use "/Tools/Tmask stk_n n_start n_end T_times bufcd bufsd bufsn", for example "c:\Tools\Tmask TOAstack 1 33 400 3 3 0" in the terminals. Or if you want to use default values, you can use "c:\Tools\Tmask stk_n n_start n_end T_times", or "c:\Tools\Tmask stk_n n_start n_end", or "c:\Tools\Tmask stk_n".

tmask-algorithm's People

Contributors

prs021 avatar googlecodeexporter avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.