本篇文章主要介绍基于面向对象法提取海岸线的步骤~

 

1.添加影像(以Landsat遥感影像为例)

1)点击Create New Project→选择影像→OK;

海岸线提取python 海岸线提取分类_海岸线提取python

2)编辑波段名称:选中需要编辑波段名称的波段→Edit(Layer Properties窗口弹出)→Layer Alias修改名称→OK;全部修改完成后点击OK,加载影像。

海岸线提取python 海岸线提取分类_sed_02

2.添加工具窗口

①Process Tree ②Class Hierarchy:显示分类类别

③Feature View ④Image Object Information

海岸线提取python 海岸线提取分类_ide_03

3.多尺度分割

1)Process Tree窗口单击右键→Append New(Edit Process窗口)→do改为分割→OK(生成分割进程);

2)Insert child→do改为多尺度分割→OK(生成多尺度分割进程);

3)单击右键(多尺度分割)→Append New→Algorithm:multiresolution segmentation;

左侧:

Domain:pixel level

右侧:

Level Settings:Level Name→Level 1;

Scale parameter:经过调试,本文设置为365。

Segmentation Settings:Image Layer weights为默认值;

Composition of homogeniety criterion:Shape设置为0.4,Compactness设置为0.5。

Execute执行算法。

海岸线提取python 海岸线提取分类_ide_04

4.水体粗分类

1)分割进程单击右键→Append New→do改为区分水体和非水体→OK(生成区分水体和非水体进程);

2)单击该进程右键选择Insert child(Edit Process窗口)→Algorithm:assign class→OK;

关于如何选择阈值选择!!!

①对水体进行粗分类(基于波段信息的均值,找到合适的临界阈值)

Feature View→Object features→Layer Values→Mean→Layer(本示例选择SWIR1波段)→单击右键Update Range(下方框内勾选后显示最大、最小均值,工具栏选择Show or Hide Outlines工具显示更加直观,绿色值大,蓝色值小);

为方便后续对比视图,于Window栏选择Split Horizontally以及Side by Side View分窗显示视图。

海岸线提取python 海岸线提取分类_ide_05

海岸线提取python 海岸线提取分类_海岸线提取python_06

 双击assign class算法设置阈值,Threshold condition→Object features→Layer Values→Mean→SWIR1(双击,Edit threshold condition窗口弹出)→Feature:Mean SWIR1,Threshold settings(本例设置为<506)→OK(返回Edit Process窗口)→Algorithm parameters→Value(water)→Class Description(颜色设置为蓝色)→OK→Execute;

②对非水体进行粗分类(基于波段信息的均值,找到合适的临界阈值)

Append New(于刚刚执行的算法处单击右键)→Algorithm(assign class)→设置阈值及分类(步骤同上);

海岸线提取python 海岸线提取分类_sed_07

为显示分类效果,选择工具栏View Classification工具 。

 

海岸线提取python 海岸线提取分类_ide_08

 5.基于Find enclosed by class算法,优化分类(以非水体为例)

Append New(Edit Process窗口)→Algorithm:Find enclosed by class

左侧:

Class filter:nonwater,unclassified;

右侧:

Search Settings→Enclosing classes:unclassified;

Classification Settings→Active classes:nonwater;

Erase old classification→Yes;

Execute执行算法。

 6.基于Merge Region算法,合并非水体

1)区分水体和非水体进程单击右键→Append New(Edit Process窗口)→do改为合并→OK;

2)合并进程单击右键→Insert child(Edit Process窗口)→Algorithm:merge region→Class filter:nonwater→Execute;

海岸线提取python 海岸线提取分类_机器学习_09

7.基于Find enclosed by image object算法,对陆地细分类

1)合并进程单击右键→Append New→Algorithm:find enclosed by image object→class filter:nonwater,unclassified→active classes:nonwater→Execute;

8.基于Merge Region算法,合并水体,操作同第6步

9.基于Find enclosed by class算法,将非水体内的水体合并为非水体

1)合并进程单击右键→Append New→Algorithm:find enclosed by class

左侧:

Class filter:nonwater,water;

Threshold condition:Object features→Geometry→Extent→Area(Pxl);

阈值选择同水体粗分类阈值选择方法!(本例选择将面积小于等于20000Pxl的水体合并为非水体);

右侧:

Search Settings→Enclosing classes:water;

Classification Settings→Active classes:nonwater;

Execute执行算法。

海岸线提取python 海岸线提取分类_机器学习_10

10.基于Merge Region算法,合并非水体,操作同第6步

11.基于Find enclosed by image object算法,将水体中的非水体分为水体

1)合并进程单击右键→Insert child→find enclosed by image object;

左侧:

Class filter:nonwater,water;

右侧:

Active classes:water;

Execute执行算法后,再次合并水体。

海岸线提取python 海岸线提取分类_Image_11

12.基于Pixel-based object resizing算法,优化水体和陆地边沿

1)合并进程单击右键→Insert child→pixel-based object resizing;

左侧:

Class filter:nonwater,unclassified;

右侧:

Candidate Surface Tension→Reference:object;

Candidate Surface Tension→Value:0.6;

Execute执行算法。

海岸线提取python 海岸线提取分类_Image_12

最终就可以得到海岸线啦~