1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
version(1.0);
baseDir = "c:/Program Files/LandSerf/data/landscriptExamples/";
image = open(baseDir&"topoMap.srf");
image = ifelse((green(image) > blue(image)) and
(green(image) > red(image)) and
(green(image)/(red(image)+blue(image)) > 0.6),1,0);
veg = new(image);
veg = median(image[-2,-2],image[-2,-1],image[-2,0],image[-2,1],image[-2,2],
image[-1,-2],image[-1,-1],image[-1,0],image[-1,1],image[-1,2],
image[ 0,-2],image[ 0,-1],image[ 0,0],image[ 0,1],image[ 0,2],
image[ 1,-2],image[ 1,-1],image[ 1,0],image[ 1,1],image[ 1,2],
image[ 2,-2],image[ 2,-1],image[ 2,0],image[ 2,1],image[ 2,2]);
colouredit(veg,"rules","0 255 255 255, 1 0 200 0");
edit(veg,"type","other");
save(veg,baseDir&"veg.srf");
|