{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Sentinel-1 processing for ship detection (SNAP)\n", "\n", "In this tutorial we will employ `eodag` for ship detection (marine surveillance) in the Gulf of Trieste using Sentinel-1 satellite-borne Synthetic Aperture Radar (SAR).\n", "\n", "Marine surveillance can be done using different technologies. A first option consists of cooperative system in which ships themselves report their identities and positions. The three most common options are Automatic Identification System (AIS), Long Range Identification and Tracking (LRIT) and Vessel Monitoring System. These systems most commonly use cameras and radars located on a variety of platforms (ship, airplanes, satellites, etc.) (source: [ESA RUS](https://rus-copernicus.eu/) tutorials).\n", "\n", "Ship detection with Sentinel-1 falls into the non-cooperative category and enables detection of vessels not carrying AIS or other tracking system on board such as smaller fishing ships or ships that are in the surveyed area illegally (illegal fishing, piracy etc.). Moreover, SAR is not reliant on solar illumination and is rather independent of weather conditions, therefore enabling frequent monitoring.\n", "\n", "\n", "To be able to follow this tutorial, you will need to:\n", "\n", "* [SNAP](http://step.esa.int/main/download/snap-download/) to use its `gpt` command. This particular command is used to execute *SNAP* raster data operators in batch-mode based on XML Graph files (see more info about the [Graph Processing Framework](https://senbox.atlassian.net/wiki/spaces/SNAP/pages/70503590/Creating+a+GPF+Graph) of *SNAP*). You need to have the `bin` folder of *SNAP* in your system *PATH*. The version used in this tutorial is the 8.0.\n", " \n", " > **Note:** If you need support to install or configure SNAP, please refer to https://forum.step.esa.int/c/snap.\n", "\n", "* Download the auxiliary files [here](https://github.com/CS-SI/eodag/tree/master/docs/notebooks/tutos/auxdata/) which contain the appropriate shapefiles.\n", "* The following Python packages: [Folium](https://python-visualization.github.io/folium/installing.html), [imageio](https://imageio.readthedocs.io/en/stable/installation.html), [Matplotlib](https://matplotlib.org/3.3.3/users/installing.html), [NumPy](https://numpy.org/install/) and [rasterio](https://rasterio.readthedocs.io/en/latest/installation.html).\n", "\n", "## Configuration\n", "\n", "Let's start by setting your personal credentials to access [PEPS service](https://peps.cnes.fr/rocket/) by filling your username and password below:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import os\n", "os.environ[\"EODAG__PEPS__AUTH__CREDENTIALS__USERNAME\"] = \"PLEASE_CHANGE_ME\"\n", "os.environ[\"EODAG__PEPS__AUTH__CREDENTIALS__PASSWORD\"] = \"PLEASE_CHANGE_ME\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you don't have the `bin` folder of *SNAP* in your system *PATH* uncomment the following lines of code, adapt the path to your installation and run it to check whether the path was correctly prepended to your *PATH*." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# Add absolute path to SNAP bin folder to make the gpt command available \n", "#os.environ[\"PATH\"] = \"PLEASE_CHANGE_ME\" + \":\" + os.environ[\"PATH\"]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's check that the Python packages required to run this notebook are available:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "import folium\n", "import imageio\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import rasterio" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Then we create a workspace directory where all our files and configuration will live:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2021-01-11 21:29:05,764-15s eodag.config [INFO ] Loading user configuration from: /home/maxime/TRAVAIL/06_EODAG/eodag/examples/eodag_workspace_shipdetection/eodag_conf.yml\n", "2021-01-11 21:29:06,075-15s eodag.core [INFO ] Locations configuration loaded from /home/maxime/.config/eodag/locations.yml\n" ] } ], "source": [ "from eodag.api.core import EODataAccessGateway\n", "from eodag import setup_logging\n", "\n", "setup_logging(verbose=2)\n", "\n", "# Create the workspace folder.\n", "workspace = 'eodag_workspace_shipdetection'\n", "if not os.path.isdir(workspace):\n", " os.mkdir(workspace)\n", "\n", "# Save the PEPS configuration file.\n", "yaml_content = \"\"\"\n", "peps:\n", " download:\n", " outputs_prefix: \"{}\"\n", " extract: true\n", "\"\"\".format(os.path.abspath(workspace))\n", "\n", "with open(os.path.join(workspace, 'eodag_conf.yml'), \"w\") as f_yml:\n", " f_yml.write(yaml_content.strip())\n", "\n", "dag = EODataAccessGateway(os.path.join(workspace, 'eodag_conf.yml'))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Search and download with `eodag`\n", "\n", "We define the type of product we want to work on and the search area." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "product_type = 'S1_SAR_GRD'\n", "extent = {\n", " 'lonmin': 13.054504,\n", " 'lonmax': 13.808441,\n", " 'latmin': 45.475540,\n", " 'latmax': 45.762733\n", "}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We make a search centered on the ninth of October 2016 via `eodag` and display the returned products on an interactive map:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "scrolled": false }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2021-01-11 21:29:10,041-15s eodag.core [INFO ] Searching product type 'S1_SAR_GRD' on provider: peps\n", "2021-01-11 21:29:10,043-15s eodag.plugins.search.qssearch [INFO ] Sending count request: https://peps.cnes.fr/resto/api/collections/S1/search.json?startDate=2017-05-01&completionDate=2017-05-02&geometry=POLYGON ((13.0545 45.4755, 13.0545 45.7627, 13.8084 45.7627, 13.8084 45.4755, 13.0545 45.4755))&productType=GRD&maxRecords=1&page=1\n", "2021-01-11 21:29:10,742-15s eodag.plugins.search.qssearch [INFO ] Sending search request: https://peps.cnes.fr/resto/api/collections/S1/search.json?startDate=2017-05-01&completionDate=2017-05-02&geometry=POLYGON ((13.0545 45.4755, 13.0545 45.7627, 13.8084 45.7627, 13.8084 45.4755, 13.0545 45.4755))&productType=GRD&maxRecords=20&page=1\n", "2021-01-11 21:29:11,546-15s eodag.core [INFO ] Found 2 result(s) on provider 'peps'\n" ] }, { "data": { "text/plain": [ "[EOProduct(id=S1A_IW_GRDH_1SDV_20170501T165831_20170501T165856_016391_01B235_1399, provider=peps), EOProduct(id=S1A_IW_GRDH_1SDV_20170501T165806_20170501T165831_016391_01B235_9CD1, provider=peps)]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "products, estimated_nbr_of_results = dag.search(\n", " productType=product_type, \n", " start='2017-05-01', \n", " end='2017-05-02',\n", " geom=extent\n", ")\n", "products" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Make this Notebook Trusted to load map: File -> Trust Notebook
" ], "text/plain": [ "" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "emap = folium.Map([45.5, 13], zoom_start=6)\n", "layer = folium.features.GeoJson(\n", " data=products.as_geojson_object(), \n", " tooltip = folium.GeoJsonTooltip(fields=['title'])\n", ").add_to(emap)\n", "emap" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "S1A_IW_GRDH_1SDV_20170501T165831_20170501T165856_016391_01B235_1399\n", "S1A_IW_GRDH_1SDV_20170501T165806_20170501T165831_016391_01B235_9CD1\n" ] } ], "source": [ "for p in products:\n", " print(p.properties['title'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We observe on the map that our region of interest is best covered by the product `S1A_IW_GRDH_1SDV_20170501T165806_20170501T165831_016391_01B235_9CD1` as it covers the major part of the Gulf of Triest.\n", "\n", "**WARNING**: Beware with the image you use in *SNAP* processing graphs, it should be the one corresponding to the shapefiles provided as auxiliary data with this tutorial. The product we want to use is the one with *index 1* in the Python object returned by the search. If you fail to respect this, the `gpt` graph *ShipDetection.xml* will not run." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "product = products[1]" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "scrolled": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2021-01-11 21:30:01,540-15s eodag.plugins.download.base [INFO ] Download url: https://peps.cnes.fr/resto/collections/S1/46d48388-c2c0-5fdb-b3c9-aadafeeedf76/download\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d2ffc526abd445bfbeccc163bcb9f058", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(HTML(value=''), FloatProgress(value=0.0, max=947323442.0), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "2021-01-11 21:30:16,576-15s eodag.plugins.download.base [INFO ] Extraction activated\n", "\n", "Extracting files from S1A_IW_GRDH_1SDV_20170501T165806_20170501T165831_016391_01B235_9CD1.zip: 0%| | 0/29 [00:00" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from IPython.display import display, Image\n", "\n", "Image(os.path.join(product_path, 'preview/quick-look.png'))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Post-process the products with *SNAP*\n", "\n", "First, we reduce the working area to a smaller one contained into the gulf. We add to the product the vector file, containing the sea-lands separation mask." ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "graph_subset = os.path.join(workspace, 'Subset.xml')\n", "with open(graph_subset, 'w') as g_1:\n", " g_1.write(\n", "\"\"\"\n", "\n", " 1.0\n", " \n", " Read\n", " \n", " \n", " ${inputproduct}\n", " \n", " \n", " \n", " Subset\n", " \n", " \n", " \n", " \n", " 500,500,15300,16600\n", " true\n", " \n", " \n", " \n", " Apply-Orbit-File\n", " \n", " \n", " \n", " \n", " \n", " Import-Vector\n", " \n", " \n", " \n", " \n", " ${vectorfile}\n", " false\n", " \n", " \n", " \n", " Write\n", " \n", " \n", " \n", " \n", " ${outputproduct}\n", " \n", " \n", "\n", "\"\"\"\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Make sure to have the auxdata folder (including the Gulf of Trieste shapefile) in your workspace folder." ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters\n", "INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL 2.2.3 found on system. JNI driver will be used.\n", "INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Installed GDAL 2.2.3 set to be used by SNAP.\n", "INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.\n", "INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Installed GDAL 2.2.3 set to be used by SNAP.\n", "Executing processing graph\n", "INFO: org.hsqldb.persist.Logger: dataFileCache open start\n", "....10%....20%....30%....40%....50%....60%....70%....80%....90% done.\n" ] } ], "source": [ "vector_file = os.path.join(workspace, 'auxdata', 'Gulf_of_Trieste_seamask_UTM33.shp')\n", "# Before calling gpt, we must set the environment\n", "# variable LD_LIBRARY_PATH to the current directory\n", "os.environ['LD_LIBRARY_PATH'] = '.'\n", "\n", "!gpt {graph_subset} -Pinputproduct={product_path} -Pvectorfile={vector_file} -Poutputproduct={os.path.join(workspace, 'S1A_IW_GRDH_1SDV_20161009T165807_4550_Orb')}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can compute the ships detection. We apply a tresholding, then a target detection, setting detection between 30 and 600m. Adaptive thresholding is a frequently used method for target detection in SAR imagery. The underlying assumption is that targets appear bright on dark background. The adaptive thresholding algorithm is applied in moving window. For each pixel under test (central pixel) a new threshold value is calculated based on the statistical characteristics of its local background, if the pixel value is above the threshold the pixel is classified as target pixel." ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "graph_process = os.path.join(workspace, 'ShipDetection.xml')\n", "with open(graph_process, 'w') as g_2:\n", " g_2.write(\n", "\"\"\"\n", "\n", " 1.0\n", " \n", " Read\n", " \n", " \n", " ${inputproduct}\n", " \n", " \n", " \n", " Land-Sea-Mask\n", " \n", " \n", " \n", " \n", " Gulf_of_Trieste_seamask_UTM33\n", " false\n", " false\n", " 10\n", " \n", " \n", " \n", " Calibration\n", " \n", " \n", " \n", " \n", " VH,VV\n", " true\n", " \n", " \n", " \n", " AdaptiveThresholding\n", " \n", " \n", " \n", " \n", " 30\n", " 500.0\n", " 800.0\n", " 12.5\n", " \n", " \n", " \n", " Object-Discrimination\n", " \n", " \n", " \n", " \n", " 30\n", " 600\n", " \n", " \n", " \n", " Write\n", " \n", " \n", " \n", " \n", " ${outputproduct1}\n", " \n", " \n", " \n", " Write\n", " \n", " \n", " \n", " \n", " ${outputproduct2}\n", " Geotiff\n", " \n", " \n", "\n", "\"\"\"\n", ")" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters\n", "INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL 2.2.3 found on system. JNI driver will be used.\n", "INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Installed GDAL 2.2.3 set to be used by SNAP.\n", "INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.\n", "INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Installed GDAL 2.2.3 set to be used by SNAP.\n", "Executing processing graph\n", "INFO: org.hsqldb.persist.Logger: dataFileCache open start\n", "....10%....20%....30%....40%....50%....60%....70%....80%....90% done.\n" ] } ], "source": [ "!gpt {graph_process} -Pinputproduct={os.path.join(workspace, 'S1A_IW_GRDH_1SDV_20161009T165807_4550_Orb.dim')} -Poutputproduct1={os.path.join(workspace, 'S1A_IW_GRDH_1SDV_20161009T165807_4550_processed')} -Poutputproduct2={os.path.join(workspace, 'S1A_IW_GRDH_1SDV_20161009T165807_4550_processed')}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Finally we generate a subset off the port of Ravenna that we will use to visualize the output. " ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "graph_visu = os.path.join(workspace, 'vizualisation_ships.xml')\n", "with open(graph_visu, 'w') as g_3:\n", " g_3.write(\n", "\"\"\"\n", "\n", " 1.0\n", " \n", " Read\n", " \n", " \n", " ${inputproduct}\n", " \n", " \n", " \n", " Subset\n", " \n", " \n", " \n", " \n", " 0,1000,10000,10000\n", " \n", " \n", " \n", " Terrain-Correction\n", " \n", " \n", " \n", " \n", " Sigma0_VH_ship_bit_msk\n", " False\n", " \n", " \n", " \n", " Write\n", " \n", " \n", " \n", " \n", " ${outputproduct}\n", " Geotiff\n", " \n", " \n", "\n", "\"\"\"\n", ")" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters\n", "INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL 2.2.3 found on system. JNI driver will be used.\n", "INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Installed GDAL 2.2.3 set to be used by SNAP.\n", "INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.\n", "INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Installed GDAL 2.2.3 set to be used by SNAP.\n", "Executing processing graph\n", "INFO: org.hsqldb.persist.Logger: dataFileCache open start\n", "INFO: org.esa.snap.core.datamodel.Product: raster width 10000 not equal to 15300\n", "INFO: org.esa.snap.core.datamodel.Product: raster width 16471 not equal to 10000\n", "INFO: org.esa.snap.core.dataop.dem.ElevationFile: http retrieving http://skywatch-auxdata.s3-us-west-2.amazonaws.com/dem/SRTM90/tiff/srtm_39_03.zip\n", "....10%....20%.INFO: org.esa.snap.core.dataop.dem.ElevationFile: http retrieving http://skywatch-auxdata.s3-us-west-2.amazonaws.com/dem/SRTM90/tiff/srtm_39_04.zip\n", "...30%....40%....50%....60%....70%....80%....90% done.\n" ] } ], "source": [ "!gpt {graph_visu} -Pinputproduct={os.path.join(workspace, 'S1A_IW_GRDH_1SDV_20161009T165807_4550_processed.dim')} -Poutputproduct={os.path.join(workspace, 'subset_visualization')}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We reproject the subset to Mercator to display it with an interactive map." ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "!rio warp {os.path.join(workspace, 'subset_visualization.tif')} {os.path.join(workspace, 'subset_visualization_3857.tif')} --dst-crs=\"EPSG:3857\" --resampling=\"bilinear\" --overwrite" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAIMCAYAAABVH87kAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAg5klEQVR4nO3df7RlZX3f8c/XGX4EFRlMYmSGBkyILUkTxAmQ2HalEpnRpA7tcqWkWXFUElbVpPnVGowrddXkj5hfJjZRS8QEs6xoJqbQBJ0MxKw0jSCgCAoio0SZAcQ4iFZXkIGnf5w9emaYYZj749nn3Pt6rXXXPefZe5/7nD2buW/22edMtdYCANDLE8aeAACwuogPAKAr8QEAdCU+AICuxAcA0JX4AAC6mpn4qKrNVXV7Ve2sqovHng8AsDxqFj7no6rWJPlEkucl2ZXk+iQ/2lq7ddSJAQBLblbOfJyVZGdr7VOtta8muTzJlpHnBAAsg1mJj/VJ7pq6v2sYAwBWmLVjT+BIVNVFSS5KkjVZ8+zjcvzIMwKA1e1Luf8fWmvfdCTbzEp87E5y8tT9DcPYflprlyS5JEmOrxPb2XVun9kBAAd1ddv26SPdZlZedrk+yWlVdWpVHZ3kgiRXjjwnAGAZzMSZj9ba3qr6qSTbk6xJ8rbW2sdGnhYAsAxmIj6SpLV2VZKrxp4HALC8ZuVlFwBglRAfAEBX4gMA6Ep8AABdiQ8AoCvxAQB0JT4AgK7EBwDQlfgAALoSHwBAV+IDAOhKfAAAXYkPAKAr8QEAdCU+AICuxAcA0JX4AAC6Eh8AQFfiA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JEzO/Z3CWxWo6Hg6nql6TZG+Sd4w9l7FU1XFJfinJfx1rDvMWH7szeY1qnw3D2IpUVUdlEh7vaK29Zxj+7HCaK8P3+4bxQ+2blbDPnpPkhVX195mc+nxukt/N5HTgvn8iYPp5fe05D8ufkuTzWRn7Ipn8n8Wu1tp1w/1tmcTIajw2kuQHk9zZWvtca+2hJO/J5JhZrcfHPkt1POzO11+imB6fO1X1kiQ/nOTHhiBLjnx/fD6HPrbmxbdlEusfGf5e3ZDkQ1X1Lel0fMxbfFyf5LThSuOjM7lY7MqR57QshtcVL01yW2vtt6cWXZlk31XGW5NcMTX+4uFK5XOSPDCcct2e5LyqWjf8H+J5w9jcaK29urW2obV2SiZ/5n/VWvuxJO9P8qJhtQP3xb599KJh/TaMX1CTdzucmuS0TC6UmiuttXuT3FVVzxyGzk1ya1bhsTH4TJJzquq44b+bfftjVR4fU5bkeBiWfbGqzhn274unHmtuVNXmTF66fWFr7StTiw71537Q3zfDsXKoY2sutNZuaa19c2vtlOHv1V2ZvMHh3vQ6Ph7v1bKz8pXJlbifyOQq5NeMPZ9lfJ7/IpPTpDcnuWn4ekEmrzdek+SOJFcnOXFYv5L8/rBfbkmyceqxXpbJRVQ7k7x07Oe2yP3yA/n6u12ekclfEjuT/EmSY4bxY4f7O4flz5ja/jXDPro9M37F/mH2wxlJbhiOj/+VydXnq/bYSPLfknw8yUeT/HEm71xYNcdHkndmcr3LQ5n8IrlwKY+HJBuHffvJJL+X4QMqZ/XrEPtjZybXLOz7+/Qth/tzzyF+3xzq2JrVr4PtjwOW/32+/m6XLseHTzgFALqat5ddAIA5Jz4AgK7EBwDQlfgAALoSHwBAV+IDAOhKfAAAXYkPAKCr/w8ZX658TX11cgAAAABJRU5ErkJggg==", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n" ] } ], "source": [ "with rasterio.open(os.path.join(workspace, 'subset_visualization_3857.tif')) as triest_gulf_tif:\n", " triest_gulf = triest_gulf_tif.read(1)\n", "# Display the image as is with matplotlib\n", "plt.figure(figsize=(9, 9))\n", "im = plt.imshow(triest_gulf, vmax=0.06)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here we read a CSV file that contains the computed ship positions in the Gulf of Trieste and display them on an map. We can observe the concentration of detected ships nearby Ravenna harbor." ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Make this Notebook Trusted to load map: File -> Trust Notebook
" ], "text/plain": [ "" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import csv\n", "from itertools import islice\n", "\n", "m = folium.Map([45, 13.6], zoom_start=8, tiles='openstreetmap')\n", "with open(os.path.join(\n", " workspace, 'S1A_IW_GRDH_1SDV_20161009T165807_4550_processed.data',\n", " 'vector_data', 'ShipDetections.csv'\n", "), 'rt', encoding='utf-8') as data:\n", " for i in islice(csv.reader(data, delimiter='\\t'), 2, None):\n", " folium.CircleMarker(\n", " [float(i[4]), float(i[5])], popup='Ship'\n", " ).add_to(m)\n", "m" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Final results\n", "\n", "We can add the subset we've done previously and display it to see if detection worked well." ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Lossy conversion from float32 to uint8. Range [0.0, 255.0]. Convert image to uint8 prior to saving to suppress this warning.\n" ] } ], "source": [ "triest_gulf = (triest_gulf * 255) / np.max(triest_gulf)\n", "imageio.imwrite(os.path.join(workspace, 'triest_gulf.png'), triest_gulf)" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/html": [ "
Make this Notebook Trusted to load map: File -> Trust Notebook
" ], "text/plain": [ "" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from folium.raster_layers import ImageOverlay\n", "\n", "ImageOverlay(\n", " image=os.path.join(workspace, 'triest_gulf.png'),\n", " name='Mercator projection SW',\n", " bounds=[[44.1979166667, 12.1022944444], [45.2606388889, 13.5819333333]],\n", " opacity=0.9,\n", ").add_to(m)\n", "\n", "folium.LayerControl().add_to(m)\n", "m" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Some islets appear to have been wrongly detected. Now you can modify parameters in thresholding and detection processes in order to optimize ships detection." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.8.10 64-bit", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" }, "vscode": { "interpreter": { "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" } } }, "nbformat": 4, "nbformat_minor": 2 }