From Open Foris Wiki

Jump to: navigation, search

oft-unique-mask-for-nn.bash - creates a unique mask for oft-nn analysis.

Unique means here, that same pixel is not classified from several images.

It is needed in 2 cases:

  1. take an adjacent image into account or
  2. use the new image to fill a cloud etc. on nn-classified base image

Usage: oft-unique-mask-for-nn.bash <-m mask of base image> <-s mask of new image>


  • As input you need a mask of the main image and a preliminary mask of the new image
  • A preliminary mask for the new image can be run with oft-trim-mask.bash
  • If you need to add clouds or water, do that before or after this unique mask script
  • The new image must be in the same projection and gridding (pixel locations)
  • In all masks, 0=do not use, 1=use
  • To take several images into account, re-run
  • Script produces also an accumulated mask, showing common ok areas


  • Get Example data set
  • For this exercise following tools are used: oft-unique-mask-for-nn.bash

1. Open your working directory using

cd /home/...

2. For this exercise we will use mask.tif (output from oft-trim-mask.bash) as mask of the base image and landsat_t2_mask.tif as the mask of the new image:

 oft-unique-mask-for-nn.bash -m mask.tif -s landsat_t2_mask.tif

3. Two output images are automatically processed: landsat_t2_mask_unique_mask.tif and landsat_t2_mask_accumulated_mask.tif

Mask of base image: mask.tif Mask of new image: landsat_t2_mask.tif Output: landsat_t2_mask_unique_mask.tif

Back to Open Foris Toolkit Main Page

Back to Tools & Exercises

Personal tools