File: faq_pksetmask.dox

package info (click to toggle)
pktools 2.6.7.6%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 9,040 kB
  • sloc: cpp: 33,451; xml: 10,955; python: 1,601; makefile: 142; sh: 58; ansic: 24
file content (8 lines) | stat: -rw-r--r-- 748 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
\section faq_pksetmask Frequently asked questions about pksetmask

 Q1. I want to mask my input image (a byte image with values between 0 and 254) with a mask that only covers a spatial subset of the input image. Within the spatial subset of the primary mask, all pixels must be set to 0 where the primary mask equals 1. Outside the spatial subset I want to set all pixel values to 255.

 A1. This can be done using two masks, selecting the input image as the secondary mask. Choose the secondary operator acting on the secondary mask such that the condition is always true (e.g, < 255 ).
\code
pksetmask -i input.tif -m mask.tif -t nodata -msknodata 0 --operator '='  -m input.tif -nodata 255 -msknodata 255 --operator '<'  -o output.tif
\endcode