Add a region growing example

This commit is contained in:
Ian Schneider
2015-07-02 13:30:11 -06:00
committed by Tim Schaub
parent 4320b07c5d
commit 6f6698dd6a
3 changed files with 178 additions and 1 deletions
+43
View File
@@ -0,0 +1,43 @@
---
template: example.html
title: Region Growing
shortdesc: Grow a region from a seed pixel
docs: >
<p>Click a region on the map. The computed region will be red.</p>
<p>
This example uses a <code>ol.source.Raster</code> to generate data
based on another source. The raster source accepts any number of
input sources (tile or image based) and runs a pipeline of
operations on the input data. The return from the final
operation is used as the data for the output source.
</p>
<p>
In this case, a single tiled source of imagery data is used as input.
The region is calculated in a single "image" operation using the "seed"
pixel provided by the user clicking on the map. The "threshold" value
determines whether a given contiguous pixel belongs to the "region" - the
difference between a candidate pixel's RGB values and the seed values must
be below the threshold.
</p>
<p>
This example also shows how an additional function can be made available
to the operation.
</p>
tags: "raster, region growing"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row">
<div class="col-md-1">
Threshold:
</div>
<div class="col-md-2">
<input id="threshold" type="range" min="1" max="50" value="20"/>
</div>
<div class="col-md-1">
<span id="threshold-value"></span>
</div>
</div>