|
1 | 1 | ## SAR for deforestation detection
|
2 | 2 |
|
3 |
| -**SAR for deforestation detection** is a script for the **Sentinel-hub EO-Browser** (https://apps.sentinel-hub.com/eo-browser) that uses the VV and VH bands of the Sentinel 1 and transforms the cartesian space of VV and VH to polar coordinates computing the length and angle of the resulting vector and also the area of the square defined by VV and VH. Then it uses the lenght of the vector as a classifier to discriminate between water, forest and soil. |
| 3 | +<a href="#" id='togglescript'>Show</a> script or [download](script.js){:target="_blank"} it. |
| 4 | +<div id='script_view' style="display:none"> |
| 5 | +{% highlight javascript %} |
| 6 | + {% include_relative script.js %} |
| 7 | +{% endhighlight %} |
| 8 | +</div> |
4 | 9 |
|
5 |
| -The script paints in black the water and bare soil areas, and uses both the length and the angle to draw a scale for the forest (green) and soil (red), drawing a stronger green where more forest has been classified and a stronger red or black where more soil has been found. |
6 |
| - |
7 |
| -The script only uses the VV and VH bands of the Sentinel 1, so it will identify bare soil as water (black) and is intended to be used in forest area, returning strange results when used in populated areas. |
| 10 | +## Evaluate and visualize |
8 | 11 |
|
9 |
| -#### Examples |
| 12 | + - [EO Browser](https://apps.sentinel-hub.com/eo-browser/?lat=-3.1254&lng=113.6286&zoom=10&time=2019-11-08&preset=CUSTOM&datasource=Sentinel-1%20AWS%20(S1-AWS-IW-VVVH)&layers=VV,VH,HH&evalscript=Ly8KLy8gU0FSIGZvciBkZWZvcmVzdGF0aW9uIGRldGVjdGlvbgovLyAtLS0tLS0tLS0tLS0KLy8gMjAxOSAtIEFudG9uaW8gQ2FybG9uIFBhcmVkZXMKLy8gTGljZW5zZTogQ0MgQlkgNC4wCi8vIGh0dHBzOi8vY3JlYXRpdmVjb21tb25zLm9yZy9saWNlbnNlcy9ieS80LjAvCi8vCmZ1bmN0aW9uIHNldHVwKGRzKSB7CiAgc2V0SW5wdXRDb21wb25lbnRzKFtkcy5WViwgZHMuVkhdKTsKICBzZXRPdXRwdXRDb21wb25lbnRDb3VudCgzKTsKfQoKY29uc3QgR0FJTiA9IDIuNTs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2X2xlbik7CiAgICB9CgogIAlpZiAodl9sZW4gPCBXQVRFUl9MSU1JVCkgewogICAgCXJldHVybiBbMF07CiAgICB9IGVsc2UgaWYgKHZfbGVuID4gRk9SRVNUX0xJTUlUKSB7CiAgICAgIAlsZXQgaW5kZXggPSBHQUlOICogdl9sZW4gLSB2X2FuZ2xlX3dlaWdodGVkOwogICAgICAgIHJldHVybiBHUkVFTl9WSVoucHJvY2VzcyhpbmRleCk7CiAgICB9IGVsc2UgewogICAgICAgIGxldCBpbmRleCA9IEdBSU4gKiB2X2xlbl9pbnZlcnNlICsgdl9hbmdsZV93ZWlnaHRlZDsKICAgICAgICByZXR1cm4gUkVEX1ZJWi5wcm9jZXNzKGluZGV4KTsKICAgIH0KfTs%3D){:target="_blank"} |
10 | 13 |
|
11 |
| -The images show several zones of Borneo, in areas affected by palm oil deforestation |
| 14 | +## General description of the script |
12 | 15 |
|
13 |
| - |
14 |
| - |
15 |
| - |
| 16 | +**SAR for deforestation detection** is a script for the [Sentinel-hub EO-Browser](https://apps.sentinel-hub.com/eo-browser){:target="_blank"}, that uses the VV and VH bands of the Sentinel-1 and transforms the cartesian space of VV and VH to polar coordinates computing the length and angle of the resulting vector and also the area of the square defined by VV and VH. Then it uses the lenght of the vector as a classifier to discriminate between water, forest and soil. |
16 | 17 |
|
17 |
| -A link to explore the results in the **Sentinel-hub EO-Browser**: |
| 18 | +The script paints in black the water and bare soil areas, and uses both the length and the angle to draw a scale for the forest (green) and soil (red), drawing a stronger green where more forest has been classified and a stronger red or black where more soil has been found. |
18 | 19 |
|
19 |
| -https://apps.sentinel-hub.com/eo-browser/?lat=-3.1254&lng=113.6286&zoom=10&time=2019-11-08&preset=CUSTOM&datasource=Sentinel-1%20AWS%20(S1-AWS-IW-VVVH)&layers=VV,VH,HH&evalscript=Ly8KLy8gU0FSIGZvciBkZWZvcmVzdGF0aW9uIGRldGVjdGlvbgovLyAtLS0tLS0tLS0tLS0KLy8gMjAxOSAtIEFudG9uaW8gQ2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oICogdmgpOwogIAlsZXQgdl9hbmdsZV93ZWlnaHRlZCA9IDA7CglpZiAodnYgPiAwKSB7CgkJdl9hbmdsZV93ZWlnaHRlZCA9IE1hdGguYXRhbih2aC92dikgLyAoTWF0aC5QSSAvIDIpOwoJfQoJbGV0IHZfbGVuX2ludmVyc2UgPSAwOwogIAlpZiAodl9sZW4gPiAwKSB7CgkJdl9sZW5faW52ZXJzZSA9IDEgLyAoSU5WRVJTRV9GQUNUT1IgKiB2X2xlbik7CiAgICB9CgogIAlpZiAodl9sZW4gPCBXQVRFUl9MSU1JVCkgewogICAgCXJldHVybiBbMF07CiAgICB9IGVsc2UgaWYgKHZfbGVuID4gRk9SRVNUX0xJTUlUKSB7CiAgICAgIAlsZXQgaW5kZXggPSBHQUlOICogdl9sZW4gLSB2X2FuZ2xlX3dlaWdodGVkOwogICAgICAgIHJldHVybiBHUkVFTl9WSVoucHJvY2VzcyhpbmRleCk7CiAgICB9IGVsc2UgewogICAgICAgIGxldCBpbmRleCA9IEdBSU4gKiB2X2xlbl9pbnZlcnNlICsgdl9hbmdsZV93ZWlnaHRlZDsKICAgICAgICByZXR1cm4gUkVEX1ZJWi5wcm9jZXNzKGluZGV4KTsKICAgIH0KfTs%3D |
| 20 | +The script only uses the VV and VH bands of the Sentinel-1, so it will identify bare soil as water (black) and is intended to be used in forested areas, returning strange results when used in populated areas. |
20 | 21 |
|
21 | 22 | #### Author
|
22 | 23 |
|
23 | 24 | Antonio Carlón Paredes
|
| 25 | + |
| 26 | +## Description of representative images |
| 27 | + |
| 28 | +The images show several zones of Borneo, in areas affected by palm oil deforestation. |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
0 commit comments