{"_id":"594ab8f6d4e1fa00240b3873","project":"55faeacad0e22017005b8265","version":{"_id":"55faeacad0e22017005b8268","project":"55faeacad0e22017005b8265","__v":33,"createdAt":"2015-09-17T16:31:06.800Z","releaseDate":"2015-09-17T16:31:06.800Z","categories":["55faeacbd0e22017005b8269","55faf550764f50210095078e","55faf5b5626c341700fd9e96","55faf8a7825d5f19001fa386","560052f91503430d007cc88f","560054f73aa0520d00da0b1a","56005aaf6932a00d00ba7c62","56005c273aa0520d00da0b3f","5601ae7681a9670d006d164d","5601ae926811d00d00ceb487","5601aeb064866b1900f4768d","5601aee850ee460d0002224c","5601afa02499c119000faf19","5601afd381a9670d006d1652","561d4c78281aec0d00eb27b6","561d588d8ca8b90d00210219","563a5f934cc3621900ac278c","5665c5763889610d0008a29e","566710a36819320d000c2e93","56ddf6df8a5ae10e008e3926","56e1c96b2506700e00de6e83","56e1ccc4e416450e00b9e48c","56e1ccdfe63f910e00e59870","56e1cd10bc46be0e002af26a","56e1cd21e416450e00b9e48e","56e3139a51857d0e008e77be","573b4f62ef164e2900a2b881","57c9d1335fd8ca0e006308ed","57e2bd9d1e7b7220000d7fa5","57f2b992ac30911900c7c2b6","58adb5c275df0f1b001ed59b","58c81b5c6dc7140f003c3c46","595412446ed4d9001b3e7b37"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"v1","version_clean":"1.0.0","version":"1"},"category":{"_id":"573b4f62ef164e2900a2b881","__v":0,"project":"55faeacad0e22017005b8265","version":"55faeacad0e22017005b8268","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-05-17T17:05:38.443Z","from_sync":false,"order":7,"slug":"algorithm-guide","title":"Certified Algorithms"},"user":"55fae9d4825d5f19001fa379","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-06-21T18:20:38.977Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":28,"body":"*Note: Access to MDA tasks is only available to customers who have purchased this package. If you want to be contacted about purchasing MDA access through GBDX, please email [gbdx-support:::at:::digitalglobe.com](mailto:gbdx-support@digitalglobe.com)*\n\n*In the GBDX catalog, the S3 location for MDA data is encrypted. Customers who have purchased access to MDA's data set and alogrithms are provided with a decrypt key. This key must be used in the python script below to get the bucket location. *\n\n*If you have have purchased MDA access and do not have a decrypt key, please contact [gbdx-support@digitalglobe.com](mailto:gbdx-support@digitalglobe.com)*\n\n## Table of Contents\n\nSection | Description\n--- | ---\n[Identifying Same-gometry Stacks](#Identifying Same-gometry Stacks) | Required parameters for identifying same-geometry stacks to use as input for this task.\n[Imagery Examples](#Imagery Examples) | Before and after examples\n[Quickstart](#Quickstart) | Get started with a Python-based quickstart tutorial\n[Task Runtime](#Task Runtime) | Benchmark runtimes for the algorithm\n[Input Options](#Input Options) | Required and optional task inputs\n[Outputs](#Outputs) | Task outputs and example contents\n[Advanced Options](#Advanced Options) | Additional information for advanced users\n[Known Issues](#Known Issues) | Issues users should be aware of\n\n## <a name=\"Identifying Same-gometry Stacks\"></a>Identifying Same-geometry Stacks\n\nThe following parameters are required to be consistent to separate RADARSAT-2 SAR Images into Same-geometry Stacks using the GBDX Catalog:\n\nParameter | GBDX Catalog name\n--- | ---\nSensor: RADARSAT-2 | \"types\" = \"RADARSAT2\",\"MDAProduct\"\nPass direction (Ascending or Descending) | passDirection\nLook direction (Right or Left) | lookDirection\nPolarization (HH, VV, HV, VH) | polarizations\nBeam mode (ExtraFine) and swath position (e.g. XF0W3, XF0W2,  etc.) | beams\nProduct type (SGF) | The GBDX catalog only includes product type \"SGF\". Using product type in the search parameters is not necessary\n\nSpatial overlap (90% usually desired, checked using footprint corner coordinates of full size images) -> currently no built-in utilities to test  for overlap, but can define a single point for an area of interest (AOI) (longitude, latitude) in decimal degrees to input to the query, e.g. AOI = “POINT(-122.142, 37.149)” or an area e.g. AOI POLYGON((31.99 68.45, 34.72 68.65, 34.18 69.74,31.32 69.53,31.99 68.45))”\n\n***Note: Incorrect same-geometry stacks may cause a workflow failure. We are working on a validation step to eliminate this possibility.***\n\nAlso see the known issues section at the end of this document. \n\n## <a name=\"Imagery Examples\"></a>Imagery Examples\n\n\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/c442cd8-Picture1.png\",\n        \"Picture1.png\",\n        2122,\n        600,\n        \"#313131\"\n      ],\n      \"caption\": \"The two images above are the output before and after SAR intensity images\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/3429d70-MDA_Red-blue_change_map.jpg\",\n        \"MDA Red-blue change map.jpg\",\n        1159,\n        600,\n        \"#424042\"\n      ],\n      \"caption\": \"The above image shows the Red-Blue Change Map from SAR Amplitude Change Detection\",\n      \"sizing\": \"80\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/52c6594-MDA_vector_change_polygons.jpg\",\n        \"MDA vector change polygons.jpg\",\n        998,\n        600,\n        \"#2d3340\"\n      ],\n      \"caption\": \"The image above shows the vector change polygons overlaid on optical imagery within Google Earth\",\n      \"sizing\": \"80\"\n    }\n  ]\n}\n[/block]\nThe above image displays example outputs  from comparing two SAR images.  The first row displays the input before and after SAR intensity images after cropping, registration, filtering and geocoding. The middle row shows the Red-Blue change map. Red areas represent a strong decrease in intensity (“red has fled”) while blue areas represent a strong increase in intensity (“blue is new”).  The pixel-wise maximum of the two SAR images is shown in gray-scale in the background for added context.  The third row shows vectorized change polygons overlaid on Google Earth optical imagery.\n\n\n## <a name=\"Quickstart\"></a>Quickstart Tutorial\n\nThis script gives an example of SAR Amplitude Change Detection End-to-End applied to a stack of same-geometry georeferenced products as input. This example script is run in a Python environment using the gbdxtools interface. Note that users need to replace the variable encrypt_key with their own secret key.\n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"from gbdxtools import Interface\\nfrom simplecrypt import decrypt\\nfrom binascii import unhexlify\\ngbdx = Interface()\\nfilters = [\\n        \\\"lookDirection = 'Right'\\\",\\n       \\\"passDirection = 'Ascending'\\\",\\n       \\\"beams = 'XF0W3'\\\",\\n       \\\"polarizations=['HH']\\\"\\n]\\nwkt_string='POLYGON ((-105.92001 42.16346, -104.55797 42.33798, -104.32654 41.25052, -105.66574 41.07524, -105.92001 42.16346))'\\ntypes = [ \\\"RADARSAT2\\\",\\\"MDAProduct\\\"]\\nresult = gbdx.catalog.search(searchAreaWkt=wkt_string,types=types)\\nbucket = 's3://' + decrypt('<<<<KEY>>>>',unhexlify(result[0]['properties']['bucketName']))\\nimages = []\\nfor res in result:\\n    images.append(decrypt('<<<<KEY>>>>',unhexlify(res['properties']['bucketPrefix'])))\\ninputs = [bucket + '/' + img for img in images]\\nprint inputs\\nend2end = gbdx.Task('MDA_sar_acd_end2end')\\n# For multiplex input, sets input_data0, input_data1, etc...\\nfor i, _in in enumerate(inputs):\\n   setattr(end2end.inputs, 'input_data%i' % i, _in)\\n# Set up cropping\\nend2end.inputs.crop_vertical_extents = '[42.16346,42.33798]'\\nend2end.inputs.crop_horizontal_extents = '[-105.92001, -104.32654]'\\nend2end.inputs.is_latlon_crop = 'true'\\nend2end.inputs.crop_images = 'true'\\n# Other parameter changes from default\\nend2end.inputs.morpho_size = '25'   # set minimum size (in pixels) of changes to keep\\nend2end.inputs.db_threshold = '9'   # set change threshold (+/-) in decibels\\nwf1 = gbdx.Workflow([end2end])\\nwf1.savedata(end2end.outputs.output_data, 'SAR_EXAMPLE_0816')\\nprint wf1.execute()\\nprint wf1.id\\nprint wf1.status\\n# Will print out runtimes for all tasks when complete. \\nimport time\\nwhile not wf1.complete:\\n    time.sleep(10)\\nfrom runtime_v2 import runtime\\nprint runtime(wf1)\\n \\n\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n## <a name=\"Task Runtime\"></a>Task Runtime\nTask runtimes are variable depending on the number of scenes in the stack, the size of the AOI specified for cropping, and the input parameters used. Runtimes on the order of tens of minutes have been recorded for a RADARSAT-2 XF SGF 2-image stack, ~12 x 12 km AOI and the default parameters. This increases to over an hour for a 5-image stack.  Further increases in runtimes are expected when processing full scenes without cropping, where runtimes on the order of ~7.5 hours for a full-size 7-image stack have been recorded.\n\n\n## <a name=\"Input Options\"></a>Input Options\n\nThe following table lists all inputs for this task.  This task will process two or more same-geometry RADARSAT-2 images. Supported product type is SGF and supported format is GeoTIFF. All inputs are optional with default values, with the exception of input_data which specifies the task’s input data locations.\n\n*Table 1 Inputs for SAR change detection task*\n\n| **Name** | **Required** | **Default** | **Valid Values** | **Description** |\n| --- | --- | --- | --- | --- |\n| input_data | True | None | Valid S3 URLs containing RADARSAT-2 image files| Specifies the stack of same-geometry RADARSAT-2 imagery to which to apply the amplitude change detection (ACD) methodology.-- Value Type: RADARSAT2 product\n| crop_vertical_extents | False | None | string double array | Provides the lower and upper latitudes of the corners of the Area of Interest. E.g. [minlat maxlat]. Recommended: minimum latitude crop extent of 3km (~0.0155°) for XF SGF data.-- Value Type: _DOUBLE_ |\n| crop_horizontal_extents | False | None | string double array | Provides the west and east longitudes of the corners of the Area of Interest. E.g. [minlon maxlon]. Recommended: minimum longitude crop extent of 3km (~0.0155° /cos(latitude)) for XF SGF data.-- Value Type: _DOUBLE_ |\n| Is_latlong_crop | False | &#39;true&#39; | &#39;true&#39;, &#39;false&#39; | Value Type: STRING |\n| crop_images | False | &#39;false&#39; | &#39;true&#39;, &#39;false&#39; | Indicates if the images are to be cropped to the indicated latitude/longitude values prior to executing the change detection.-- Value Type: STRING |\n| lut_type | False | &#39;sigma&#39; | &#39;sigma&#39;, &#39;beta&#39;, &#39;gamma&#39; | The calibration scaling look-up table to be applied to convert the images from  16-bit (integer) to 32-bit (float) radar reflectivity values.—Value Type: STRING |\n| filter_type | False | &#39;mtf&#39; for n  4 images, otherwise &#39;lee&#39; | &#39;mtf&#39;, &#39;boxcar&#39;, &#39;lee&#39;, &#39;none&#39; | Indicates type of speckle filtering applied to the stack of images. mtf = Multi-Temporal Filter (combined spatial-temporal filter to reduce speckle while preserving spatial resolution), boxcar = square filter,  lee = Refined Lee filter preserving edges – Value Type: STRING |\n| filter_size | False | &#39;13&#39; | String odd integer | Indicates size of square speckle filter Recommended: value between 7 – 13 for &#39;mtf&#39; and &#39;lee&#39; _filter\\_type_; value between  3 – 11 for &#39;boxcar&#39; _filter\\_type_ —Value Type: INTEGER  |\n| saturate_flag | False | &#39;true&#39; | &#39;true&#39;, &#39;false&#39; | Indicates if change maps are saturated to pure color (red/blue) or modulated by the maximum intensity of image1 and image2. — Value Type: STRING |\n| scale_value | False | &#39;[-20 0]&#39; | String integer array | Provides the upper and lower bounds (units of decibels) for scaling the SAR intensity maps and the background of the change maps -- Value Type: _INTEGER_ |\n| morpho_size | False | &#39;0&#39; | String integer | Indicates the minimum size (total size in pixels) of changes to keep – Value Type: INTEGER |\n| db_threshold | False | &#39;7.0&#39; | String double | Indicates the threshold in decibels in the form [-δblue δred] to apply to the ratio of the 2 SAR images to detect strong changes. Alternatively a single number can be input in which case symmetric thresholds [-δ δ] are applied. – Value Type: DOUBLE |\n| vectorization_min_short_edge | False | \"1\" | String integer | Keep vectorized change polygons with short edge length in pixels greater than or equal to this value\n| vectorization_min_long_edge | False | \"1\" | String integer | Keep vectorized change polygons with long edge length in pixels greater than or equal to this value\n\n## <a name=\"Outputs\"></a>Outputs\n\nThe following table lists the outputs from this task.\n\n*Table 2 Output for SAR change detection task*\n\n| **Name** | **Required** | **Description** |\n| --- | --- | --- |\n| output_data | True | S3 location where output products are stored |\n\nThe output_data port specifies the output location in the user’s GBDX customer bucket. For n input products, the outputs products are n SAR intensity maps, (n-1) ternary change maps and (n-1) red-blue change maps in GeoTIFF format, and (n-1) vector layers in KML format. \n\nThe output intensity maps have been cropped, fine registered, speckle filtered, geocoded and converted to 1-band 8-bit format for straightforward visualization.\n\nThe change maps are formed by ratioing consecutive radar intensity images (image1/image2) and thresholding according to the db_threshold parameter. If the morpho_size parameter is set, a morphological operator is applied to remove small areas of change to reduce false alarms. In the ternary change map, areas with no change above the threshold are set to 0, while areas with a positive log-ratio (image1 > image2) are set to 1 and areas with a negative log-ratio (image1 < image2) are set to -1. \n\nThe red-blue change maps are provided to visualize the ternary maps with added context from the SAR intensity images. In the red-blue change maps, red areas indicate a large decrease in backscatter and blue areas indicate a large increase in backscatter between image acquisitions. Changes are overlaid on a grayscale radar intensity background image formed from max(image1, image2).The outputs are geocoded change maps in 3-band RGB 8-bit format.\n\nThe change polygons are created by vectorizing the ternary change maps. As for the red-blue change maps, red polygons indicate a decrease in backscatter and blue areas indicate an increase in backscatter between image acquisitions.\n\nThe following table describes some of the properties of the output products. All raster images are geocoded to the Universal Transverse Mercator (UTM) coordinate system. The vector products are given in geographic latitude and longitude coordinates.\n\n\nThe following table describes some of the properties of the output products. All images are geocoded to the Universal Transverse Mercator (UTM) coordinate system.\n\n*Table 3 Properties of the Output Products*\n\n **Name** | **Coordinate System** | **Band**  **Grouping** | **Data**  **Type** | **Description** |\n --- | --- | --- | --- | --- \nRS2&#95;<BeamMode>&#95;<Pol>&#95;<Date&Time>&#95;<crop>&#95;<lut_type>&#95;<reg/REG>&#95;<filter&#95;type>&#95;geo&#95;viz8|UTMWGS84 | 1-Band | 8-bit Unsigned Byte | Intensity map  \nRS2&#95;<BeamMode>&#95;<Pol>&#95;<MasterDate&Time>&#95;<SlaveDate&Time>&#95;<filter_type>&#95;ar&#95;geo&#95;ternary |UTMWGS84 | 1-Band | 32-bit Float | Ternary change map (values of -1, 0,1) \nRS2&#95;<BeamMode>&#95;<Pol>&#95;<MasterDate&Time>&#95;<SlaveDate&Time>&#95;<filter_type>&#95;ar&#95;geo&#95;RBmap | UTM WGS84 | 3-Band (R,G,B) | 8-bit Unsigned Byte | Red-blue change map  \nRS2&#95;<BeamMode>&#95;<Pol>&#95;<MasterDate&Time>&#95;<SlaveDate&Time>&#95;<filter_type>&#95;ar&#95;geo&#95;ternary&#95;vector&#95;<vector&#95;min&#95;short&#95;edge >&#95;< vector&#95;min&#95;long&#95;edge>.kml | Geographic WGS84 | N/A | Vector KML | Vectorized change polygons\n\n\nWhere:\n<BeamMode> = RADARSAT-2 beam mode of acquisition (e.g. ‘XFW03’)\n<Pol> = Polarization (e.g. ‘HH’)\n<Date&Time> = 8 character date and 6 character UTC time of image acquisition in the format ‘YYYYMMDD_HHMMSS’ (YearMonthDay_HoursMinutesSeconds)\n<crop> = ‘crop’ if input parameter *crop_images* = ‘true’, otherwise omitted\n<lut_type> = input parameter *lut_type* (e.g. ‘sigma’)\n<reg/REG> = ‘reg’ for all scenes except the registration master scene which is denoted ‘REG’\n<filter_type> = ‘box#x#’, ‘lee#’ or ‘mt#’ depending on input parameter *filter_type*, where # = input parameter *filter_size*, (e.g. ‘mt13’)\n< vector_min_short_edge >= Set according to *parameter vectorization_min_short_edge*\n\n< vector_min_long_edge >= Set according to *parameter vectorization_min_long_edge*\n\n\nThe output product names will depend on the input parameters and the image products input to the task including acquisition beam mode, polarization, and dates and times. The following example lists the output directories from the AWS Command Line Interface (CLI) after running the task with default settings for a stack of 6 images. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \">> aws s3 ls s3://gbd-customer-data/<customer_bucket_name>/demo_end2end/\\nPRE RS2_XF0W3_HH_20160326_151945_20160419_151944_mt13_ar_geo_RBmap/\\nPRE RS2_XF0W3_HH_20160326_151945_20160419_151944_mt13_ar_geo_ternary/\\nPRE RS2_XF0W3_HH_20160419_151944_20160513_151943_mt13_ar_geo_RBmap/\\nPRE RS2_XF0W3_HH_20160419_151944_20160513_151943_mt13_ar_geo_ternary/\\nPRE RS2_XF0W3_HH_20160513_151943_20160606_151942_mt13_ar_geo_RBmap/\\nPRE RS2_XF0W3_HH_20160513_151943_20160606_151942_mt13_ar_geo_ternary/\\nPRE RS2_XF0W3_HH_20160606_151942_20160630_151941_mt13_ar_geo_RBmap/\\nPRE RS2_XF0W3_HH_20160606_151942_20160630_151941_mt13_ar_geo_ternary/\\nPRE RS2_XF0W3_HH_20160630_151941_20160724_151940_mt13_ar_geo_RBmap/\\nPRE RS2_XF0W3_HH_20160630_151941_20160724_151940_mt13_ar_geo_ternary/\\nPRE RS2_XF0W3_HH_SGF_20160326_151945_crop_sigma_REG_mt13_geo_viz8b/\\nPRE RS2_XF0W3_HH_SGF_20160419_151944_crop_sigma_reg_mt13_geo_viz8b/\\nPRE RS2_XF0W3_HH_SGF_20160513_151943_crop_sigma_reg_mt13_geo_viz8b/\\nPRE RS2_XF0W3_HH_SGF_20160606_151942_crop_sigma_reg_mt13_geo_viz8b/\\nPRE RS2_XF0W3_HH_SGF_20160630_151941_crop_sigma_reg_mt13_geo_viz8b/\\nPRE RS2_XF0W3_HH_SGF_20160724_151940_crop_sigma_reg_mt13_geo_viz8b/\\n2017-07-27 17:27:21     519474 RS2_XF0W3_HH_20160326_151945_20160419_151944_mt13_ar_geo_ternary_vector_1_1.kml\\n2017-07-27 17:27:21    2889592 RS2_XF0W3_HH_20160419_151944_20160513_151943_mt13_ar_geo_ternary_vector_1_1.kml\\n2017-07-27 17:27:21     698577 RS2_XF0W3_HH_20160513_151943_20160606_151942_mt13_ar_geo_ternary_vector_1_1.kml\\n2017-07-27 17:27:21     214303 RS2_XF0W3_HH_20160606_151942_20160630_151941_mt13_ar_geo_ternary_vector_1_1.kml\\n2017-07-27 17:27:21     211951 RS2_XF0W3_HH_20160630_151941_20160724_151940_mt13_ar_geo_ternary_vector_1_1.kml\\n\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nThe following three boxes list the contents of the first red-blue change map directory, the first ternary map directory, and the first radar intensity directory from the AWS CLI, respectively.\n\n\n### first red-blue change map directory contents\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \">> aws s3 ls s3://gbd-customer-data/<customer_bucket_name>/demo_end2end/RS2_XF0W3_HH_20160326_151945_20160419_151944_mt13_ar_geo_RBmap/ --human-readable\\n\\n2017-07-27 17:27:23  255.2 KiB BrowseImage.tif\\n2017-07-27 17:27:23   47.2 KiB LI-11525-12 RS2 EULA_Single User_V1-9_15JUN2011_ENGLISH.pdf\\n2017-07-27 17:27:22  810.1 MiB RS2_XF0W3_HH_20160326_151945_20160419_151944_mt13_ar_geo_ternary.tif\\n2017-07-27 17:27:23    3.6 KiB erpHistory.xml\\n2017-07-27 17:27:23  328.2 KiB input_product.xml\\n2017-07-27 17:27:23  328.1 KiB input_slaveProduct.xml\\n2017-07-27 17:27:24  488.2 KiB lutBeta.xml\\n2017-07-27 17:27:36  488.2 KiB lutGamma.xml\\n2017-07-27 17:27:23  488.2 KiB lutSigma.xml\\n2017-07-27 17:27:23    3.6 KiB product.kml\\n2017-07-27 17:27:23  358 Bytes readme.txt\\n2017-07-27 17:27:23    2.4 KiB rpc.xml\\n\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n### first ternary map directory content\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \">> aws s3 ls s3://gbd-customer-data/<customer_bucket_name>/demo_end2end/RS2_XF0W3_HH_20160326_151945_20160419_151944_mt13_ar_geo_ternary/ --human-readable\\n\\n2017-07-27 17:27:23  255.2 KiB BrowseImage.tif\\n2017-07-27 17:27:23   47.2 KiB LI-11525-12 RS2 EULA_Single User_V1-9_15JUN2011_ENGLISH.pdf\\n2017-07-27 17:27:22  810.1 MiB RS2_XF0W3_HH_20160326_151945_20160419_151944_mt13_ar_geo_ternary.tif\\n2017-07-27 17:27:23    3.6 KiB erpHistory.xml\\n2017-07-27 17:27:23  328.2 KiB input_product.xml\\n2017-07-27 17:27:23  328.1 KiB input_slaveProduct.xml\\n2017-07-27 17:27:24  488.2 KiB lutBeta.xml\\n2017-07-27 17:27:36  488.2 KiB lutGamma.xml\\n2017-07-27 17:27:23  488.2 KiB lutSigma.xml\\n2017-07-27 17:27:23    3.6 KiB product.kml\\n2017-07-27 17:27:23  358 Bytes readme.txt\\n2017-07-27 17:27:23    2.4 KiB rpc.xml\\n\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n### first radar intensity directory contents\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \">> aws s3 ls s3://gbd-customer-data/<customer_bucket_name>/demo_end2end/RS2_XF0W3_HH_SGF_20160326_151945_crop_sigma_REG_mt13_geo_viz8b/ --human-readable\\n\\n2017-07-27 17:27:21  255.2 KiB BrowseImage.tif\\n2017-07-27 17:27:21   47.2 KiB LI-11525-12 RS2 EULA_Single User_V1-9_15JUN2011_ENGLISH.pdf\\n2017-07-27 17:27:21  202.5 MiB RS2_XF0W3_HH_SGF_20160326_151945_crop_sigma_REG_mt13_geo_viz8b.tif\\n2017-07-27 17:27:21    1.7 KiB erpHistory.xml\\n2017-07-27 17:27:21  328.2 KiB input_product.xml\\n2017-07-27 17:27:20  488.2 KiB lutBeta.xml\\n2017-07-27 17:27:22  488.2 KiB lutGamma.xml\\n2017-07-27 17:27:21  488.2 KiB lutSigma.xml\\n2017-07-27 17:27:21    3.6 KiB product.kml\\n2017-07-27 17:27:21  358 Bytes readme.txt\\n2017-07-27 17:27:21    2.4 KiB rpc.xml\\n\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n*Table 4 GeoTIFF intensity map of type UINT8x1. The data will be displayed using the following color codes:*\n\n| **Color** | **Value** | **Class Description** |\n| --- | --- | --- |\n| Black | 0 | Intensity given by lower bound of scale\\_value |\n| Gray | 1 – 254 | Intensity between upper and lower bounds of scale\\_value |\n| White | 255 | Intensity given by upper bound of scale\\_value |\n\n*Table 5 GeoTIFF ternary change map of type FLOAT. The data are assigned using the following values:*\n\n| **Value **| **Class Description** |\n| --- | --- | \n| -1 | Negative log-ratio of image1/image2 above db_threshold. i.e. Strong increase in backscatter between image1 and  image2\n| 1 | Positive log-ratio of image1/image2 above db_threshold  i.e. Strong decrease in backscatter between image1 and  image2 | \n| 0 | No change above threshold | \n\n*Table 6 GeoTIFF red-blue change map of type UINT8x3. The data will be displayed using the following color codes (if saturate_flag = ‘true’; if saturate_flag = ‘false’ red and blue values are scaled by the radar intensity of each pixel):*\n\n\n| **Color** | **RGB Value** | **Class Description** |\n| --- | --- | --- |\n| Red | [255,0,0] | &quot;Red is Fled&quot; – Strong decrease in backscatter between image1 and image2 |\n| Blue | [0,0,255] | &quot;Blue is new&quot; – Strong increase in backscatter  between image1 and image2 |\n| Grayscale | [x, x, x] for 0 ≤ x ≤ 255 | Radar intensity background |\n\nNote that the images are padded with NaN (not a number) values after geocoding in locations where no information exists.\n\n\n## <a name=\"Advanced Options\"></a>Advanced Options\nThe task parameters can be set in various combinations to detect different types of changes and to effectively visualize the changes.\n\n### General guidelines\n•\t**scale_value**: Default scaling of the background intensity image between -20 and 0 decibels is a good starting point for many co-polarized (HH or VV) SAR products. However these bounds may not be appropriate for all land covers and applications and can be iteratively refined by trial-and-error. If users would like to brighten the background over very smooth surfaces they can lower the scaling bounds (e.g. [-25 -5] dB) or for very bright areas such as urban environments they can raise the scaling bounds (e.g. [-15 5] dB).  \n\n•\t**morpho_size**: By default no morphological operator is applied after thresholding. However this parameter may be set to remove objects smaller than a specified size, given in pixels. Removing small objects is recommended to make the change map less cluttered and easier to analyze visually. A size of at least 2 to 3 pixels can be used to remove isolated pixels.\n\t\n•\t**vectorization_min_short_edge and vectorization_min_long_edge**: By default all changes  in the ternary map (after applying morphological operators) are vectorized, and the minimum short and long edge vector lengths are 1x1 pixels. These parameters can be increased if users know the minimum size of the changes of interest in each dimension. Users can set the minimum short and long edge sizes separately to detect changes that are narrow in one dimension (e.g. rectangular features such as extended buildings, road construction, etc.). This  parameter can also be set if users want see all changes in the ternary map, but only want to keep vectorized change polygons of larger changes.\n\n### Large Man-made Target Changes\n\nThe default parameters are already optimized to detect large man-made targets such as ships, aircraft and large vehicles. However the following parameters may be varied to improve detection and visualization performance in certain conditions:\n\n•\t**db_threshold**: The default value of ±7 dB generally yields reasonable results to detect changes for man-made objects.  However this threshold can be increased (e.g. to ± 8 or ±9 dB) to isolate especially bright changes and thereby remove extraneous changes.  However if set too high, targets of interest may be missed.\n\n•\t**morpho_size**: If the minimum size of the target(s) of interest are known, the morphological operator size may be set to isolate the changes of interest. To determine the morphological operator size, users can divide the area of the smallest object they are interested in by the pixel area. RADARSAT-2 XF data with SGF 1-look product type have a pixel spacing of 3.13 x 3.13 m.  For instance, to detect a large transport vehicle of size ~20 m x 3 m = 60 m<sup>2</sup>, one could apply a morphological operator of ~ 60 m<sup>2</sup> / (3.13 m)<sup>2</sup> 6 pixels. \n\n•\t**vectorization_min_short_edge and vectorization_min_long_edge:** if users would like to reduce the number of vectorized change polygons, they can eliminate smaller polygons by increasing the minimum short and long edge parameters.\n\n•\t**scale_value**: The same recommendations apply as stated in the general guidelines, although if users would like to see additional detail in the intensity images over bright targets of interest, they may choose very high scaling bounds (e.g. [-5 20] dB for bright ships), although this will significantly reduce the contrast of the background image.\n\n### Urban Area Change Detection\n•\t**db_threshold**: Although in most cases a symmetric threshold gives reasonable results for change detection, sometimes asymmetric thresholds can be more appropriate.  For example, if a new building has been built alongside new roads, the high intensity change (building) should be detected as new (blue/negative change) and the dim intensity change (roads) should be detected as fled (red/positive change) when taking the logarithmic difference of image1 – image2. In such a case, asymmetric threshold values, for instance,  and  (db_threshold = [-8 1]) would detect more of the changes of interest.\n\n\n\n##<a name=\"Known Issues\"></a>Known Issues\n\n•\tDue to limits on disk space available per task, a maximum of 9 full-size XF images with SGF 1-look product type can be processed in a single task. If users crop images, then thicker stacks can be supported, where maximum stack size will depend on the size of the crop.\n\n•\tThe algorithm does not perform well on small image crops (< 1000x1000 pixels or ~< 3x3 km for RADARSAT-2 XF data with SGF 1-look product type) due to issues registering the stack together.\n\n•\tThe software has best results if overlap between all images in the stack (before cropping) is  90%. \n\n•\tThe software has not been tested on images straddling the International Date Line.\n\n•\tThe software works well using the ‘default’ GBDX domain, corresponding to AWS EC2 Instance r4.2xlarge. For processing stacks of full-size images (i.e. no cropping), additional time savings can be achieved using the r44xlarge or raid domains.   The following GBDX domains should not be used: nvidiagpu, nvidiag2, t2medium.\n\n•\tThe software has not been tested on filter sizes larger than 13x13 pixels. There could be memory and/or performance implications for larger filter sizes.\n\n•\tThe output intensity and change map images have been geocoded using a Digital Elevation Model (DEM) supplied internally by GBDX.  Inaccuracies in the DEM due to changes in the terrain since the DEM was acquired, the limited spatial resolution of the DEM, or man-made features such as buildings not included in the DEM can introduce artifacts and shifts in the location of the output pixels. \n\n#### Contact Us   \nIf you have any questions or issues with this task, please contact [**gbdx-support@digitalglobe.com** ](mailto:gbdx-support@digitalglobe.com).","excerpt":"This task applies a stack-based amplitude change detection (ACD) methodology to RADARSAT-2 SAR images to produce a series of Geocoded Change Maps and Geocoded Change Vectors. The task pre-processes the imagery stack to fine register the imagery to a sub-pixel level and reduce speckle. Then it applies an ACD algorithm pairwise through the imagery stack. Finally, the task orthorectifies the intensity and change detection products using a DEM and creates Red & Blue Change Maps (raster format) and Change Polygons (vector format).\n\n\n**GBDX Registered Name**: MDA_sar_acd_end2end\n**Provider**: MDA Geospatial Services Inc.\n**Inputs**: Stack of n RADARSAT-2 same-geometry(see below) georeferenced SGF products in GeoTIFF format.           \n            (the products can be given in any order; the task will automatically sort the scenes\n             chronologically)\n**Outputs**: Series of n of registered, speckle filtered and scaled GeoTIFF images of type UINT8\n   Series (n-1) of ternary change images of type FLOAT\n   Series (n-1) of RGB GeoTIFF Change Map images of type UINT8x3\n   Series (n-1) of vector layers containing change polygons in KML format\n\n**Compatible bands & sensors**: RADARSAT-2 imagery, SGF product type","slug":"mda-sar-amplitude-change-detection-end-to-end-workflow","type":"basic","title":"MDA® SAR Amplitude Change Detection End-to-End Workflow"}

MDA® SAR Amplitude Change Detection End-to-End Workflow

This task applies a stack-based amplitude change detection (ACD) methodology to RADARSAT-2 SAR images to produce a series of Geocoded Change Maps and Geocoded Change Vectors. The task pre-processes the imagery stack to fine register the imagery to a sub-pixel level and reduce speckle. Then it applies an ACD algorithm pairwise through the imagery stack. Finally, the task orthorectifies the intensity and change detection products using a DEM and creates Red & Blue Change Maps (raster format) and Change Polygons (vector format). **GBDX Registered Name**: MDA_sar_acd_end2end **Provider**: MDA Geospatial Services Inc. **Inputs**: Stack of n RADARSAT-2 same-geometry(see below) georeferenced SGF products in GeoTIFF format. (the products can be given in any order; the task will automatically sort the scenes chronologically) **Outputs**: Series of n of registered, speckle filtered and scaled GeoTIFF images of type UINT8 Series (n-1) of ternary change images of type FLOAT Series (n-1) of RGB GeoTIFF Change Map images of type UINT8x3 Series (n-1) of vector layers containing change polygons in KML format **Compatible bands & sensors**: RADARSAT-2 imagery, SGF product type

*Note: Access to MDA tasks is only available to customers who have purchased this package. If you want to be contacted about purchasing MDA access through GBDX, please email [gbdx-support@digitalglobe.com](mailto:gbdx-support@digitalglobe.com)* *In the GBDX catalog, the S3 location for MDA data is encrypted. Customers who have purchased access to MDA's data set and alogrithms are provided with a decrypt key. This key must be used in the python script below to get the bucket location. * *If you have have purchased MDA access and do not have a decrypt key, please contact [gbdx-support@digitalglobe.com](mailto:gbdx-support@digitalglobe.com)* ## Table of Contents Section | Description --- | --- [Identifying Same-gometry Stacks](#Identifying Same-gometry Stacks) | Required parameters for identifying same-geometry stacks to use as input for this task. [Imagery Examples](#Imagery Examples) | Before and after examples [Quickstart](#Quickstart) | Get started with a Python-based quickstart tutorial [Task Runtime](#Task Runtime) | Benchmark runtimes for the algorithm [Input Options](#Input Options) | Required and optional task inputs [Outputs](#Outputs) | Task outputs and example contents [Advanced Options](#Advanced Options) | Additional information for advanced users [Known Issues](#Known Issues) | Issues users should be aware of ## <a name="Identifying Same-gometry Stacks"></a>Identifying Same-geometry Stacks The following parameters are required to be consistent to separate RADARSAT-2 SAR Images into Same-geometry Stacks using the GBDX Catalog: Parameter | GBDX Catalog name --- | --- Sensor: RADARSAT-2 | "types" = "RADARSAT2","MDAProduct" Pass direction (Ascending or Descending) | passDirection Look direction (Right or Left) | lookDirection Polarization (HH, VV, HV, VH) | polarizations Beam mode (ExtraFine) and swath position (e.g. XF0W3, XF0W2, etc.) | beams Product type (SGF) | The GBDX catalog only includes product type "SGF". Using product type in the search parameters is not necessary Spatial overlap (90% usually desired, checked using footprint corner coordinates of full size images) -> currently no built-in utilities to test  for overlap, but can define a single point for an area of interest (AOI) (longitude, latitude) in decimal degrees to input to the query, e.g. AOI = “POINT(-122.142, 37.149)” or an area e.g. AOI POLYGON((31.99 68.45, 34.72 68.65, 34.18 69.74,31.32 69.53,31.99 68.45))” ***Note: Incorrect same-geometry stacks may cause a workflow failure. We are working on a validation step to eliminate this possibility.*** Also see the known issues section at the end of this document. ## <a name="Imagery Examples"></a>Imagery Examples [block:image] { "images": [ { "image": [ "https://files.readme.io/c442cd8-Picture1.png", "Picture1.png", 2122, 600, "#313131" ], "caption": "The two images above are the output before and after SAR intensity images" } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/3429d70-MDA_Red-blue_change_map.jpg", "MDA Red-blue change map.jpg", 1159, 600, "#424042" ], "caption": "The above image shows the Red-Blue Change Map from SAR Amplitude Change Detection", "sizing": "80" } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/52c6594-MDA_vector_change_polygons.jpg", "MDA vector change polygons.jpg", 998, 600, "#2d3340" ], "caption": "The image above shows the vector change polygons overlaid on optical imagery within Google Earth", "sizing": "80" } ] } [/block] The above image displays example outputs from comparing two SAR images. The first row displays the input before and after SAR intensity images after cropping, registration, filtering and geocoding. The middle row shows the Red-Blue change map. Red areas represent a strong decrease in intensity (“red has fled”) while blue areas represent a strong increase in intensity (“blue is new”). The pixel-wise maximum of the two SAR images is shown in gray-scale in the background for added context. The third row shows vectorized change polygons overlaid on Google Earth optical imagery. ## <a name="Quickstart"></a>Quickstart Tutorial This script gives an example of SAR Amplitude Change Detection End-to-End applied to a stack of same-geometry georeferenced products as input. This example script is run in a Python environment using the gbdxtools interface. Note that users need to replace the variable encrypt_key with their own secret key. [block:code] { "codes": [ { "code": "from gbdxtools import Interface\nfrom simplecrypt import decrypt\nfrom binascii import unhexlify\ngbdx = Interface()\nfilters = [\n \"lookDirection = 'Right'\",\n \"passDirection = 'Ascending'\",\n \"beams = 'XF0W3'\",\n \"polarizations=['HH']\"\n]\nwkt_string='POLYGON ((-105.92001 42.16346, -104.55797 42.33798, -104.32654 41.25052, -105.66574 41.07524, -105.92001 42.16346))'\ntypes = [ \"RADARSAT2\",\"MDAProduct\"]\nresult = gbdx.catalog.search(searchAreaWkt=wkt_string,types=types)\nbucket = 's3://' + decrypt('<<<<KEY>>>>',unhexlify(result[0]['properties']['bucketName']))\nimages = []\nfor res in result:\n images.append(decrypt('<<<<KEY>>>>',unhexlify(res['properties']['bucketPrefix'])))\ninputs = [bucket + '/' + img for img in images]\nprint inputs\nend2end = gbdx.Task('MDA_sar_acd_end2end')\n# For multiplex input, sets input_data0, input_data1, etc...\nfor i, _in in enumerate(inputs):\n setattr(end2end.inputs, 'input_data%i' % i, _in)\n# Set up cropping\nend2end.inputs.crop_vertical_extents = '[42.16346,42.33798]'\nend2end.inputs.crop_horizontal_extents = '[-105.92001, -104.32654]'\nend2end.inputs.is_latlon_crop = 'true'\nend2end.inputs.crop_images = 'true'\n# Other parameter changes from default\nend2end.inputs.morpho_size = '25' # set minimum size (in pixels) of changes to keep\nend2end.inputs.db_threshold = '9' # set change threshold (+/-) in decibels\nwf1 = gbdx.Workflow([end2end])\nwf1.savedata(end2end.outputs.output_data, 'SAR_EXAMPLE_0816')\nprint wf1.execute()\nprint wf1.id\nprint wf1.status\n# Will print out runtimes for all tasks when complete. \nimport time\nwhile not wf1.complete:\n time.sleep(10)\nfrom runtime_v2 import runtime\nprint runtime(wf1)\n \n", "language": "python" } ] } [/block] ## <a name="Task Runtime"></a>Task Runtime Task runtimes are variable depending on the number of scenes in the stack, the size of the AOI specified for cropping, and the input parameters used. Runtimes on the order of tens of minutes have been recorded for a RADARSAT-2 XF SGF 2-image stack, ~12 x 12 km AOI and the default parameters. This increases to over an hour for a 5-image stack. Further increases in runtimes are expected when processing full scenes without cropping, where runtimes on the order of ~7.5 hours for a full-size 7-image stack have been recorded. ## <a name="Input Options"></a>Input Options The following table lists all inputs for this task. This task will process two or more same-geometry RADARSAT-2 images. Supported product type is SGF and supported format is GeoTIFF. All inputs are optional with default values, with the exception of input_data which specifies the task’s input data locations. *Table 1 Inputs for SAR change detection task* | **Name** | **Required** | **Default** | **Valid Values** | **Description** | | --- | --- | --- | --- | --- | | input_data | True | None | Valid S3 URLs containing RADARSAT-2 image files| Specifies the stack of same-geometry RADARSAT-2 imagery to which to apply the amplitude change detection (ACD) methodology.-- Value Type: RADARSAT2 product | crop_vertical_extents | False | None | string double array | Provides the lower and upper latitudes of the corners of the Area of Interest. E.g. [minlat maxlat]. Recommended: minimum latitude crop extent of 3km (~0.0155°) for XF SGF data.-- Value Type: _DOUBLE_ | | crop_horizontal_extents | False | None | string double array | Provides the west and east longitudes of the corners of the Area of Interest. E.g. [minlon maxlon]. Recommended: minimum longitude crop extent of 3km (~0.0155° /cos(latitude)) for XF SGF data.-- Value Type: _DOUBLE_ | | Is_latlong_crop | False | &#39;true&#39; | &#39;true&#39;, &#39;false&#39; | Value Type: STRING | | crop_images | False | &#39;false&#39; | &#39;true&#39;, &#39;false&#39; | Indicates if the images are to be cropped to the indicated latitude/longitude values prior to executing the change detection.-- Value Type: STRING | | lut_type | False | &#39;sigma&#39; | &#39;sigma&#39;, &#39;beta&#39;, &#39;gamma&#39; | The calibration scaling look-up table to be applied to convert the images from 16-bit (integer) to 32-bit (float) radar reflectivity values.—Value Type: STRING | | filter_type | False | &#39;mtf&#39; for n 4 images, otherwise &#39;lee&#39; | &#39;mtf&#39;, &#39;boxcar&#39;, &#39;lee&#39;, &#39;none&#39; | Indicates type of speckle filtering applied to the stack of images. mtf = Multi-Temporal Filter (combined spatial-temporal filter to reduce speckle while preserving spatial resolution), boxcar = square filter, lee = Refined Lee filter preserving edges – Value Type: STRING | | filter_size | False | &#39;13&#39; | String odd integer | Indicates size of square speckle filter Recommended: value between 7 – 13 for &#39;mtf&#39; and &#39;lee&#39; _filter\_type_; value between 3 – 11 for &#39;boxcar&#39; _filter\_type_ —Value Type: INTEGER | | saturate_flag | False | &#39;true&#39; | &#39;true&#39;, &#39;false&#39; | Indicates if change maps are saturated to pure color (red/blue) or modulated by the maximum intensity of image1 and image2. — Value Type: STRING | | scale_value | False | &#39;[-20 0]&#39; | String integer array | Provides the upper and lower bounds (units of decibels) for scaling the SAR intensity maps and the background of the change maps -- Value Type: _INTEGER_ | | morpho_size | False | &#39;0&#39; | String integer | Indicates the minimum size (total size in pixels) of changes to keep – Value Type: INTEGER | | db_threshold | False | &#39;7.0&#39; | String double | Indicates the threshold in decibels in the form [-δblue δred] to apply to the ratio of the 2 SAR images to detect strong changes. Alternatively a single number can be input in which case symmetric thresholds [-δ δ] are applied. – Value Type: DOUBLE | | vectorization_min_short_edge | False | "1" | String integer | Keep vectorized change polygons with short edge length in pixels greater than or equal to this value | vectorization_min_long_edge | False | "1" | String integer | Keep vectorized change polygons with long edge length in pixels greater than or equal to this value ## <a name="Outputs"></a>Outputs The following table lists the outputs from this task. *Table 2 Output for SAR change detection task* | **Name** | **Required** | **Description** | | --- | --- | --- | | output_data | True | S3 location where output products are stored | The output_data port specifies the output location in the user’s GBDX customer bucket. For n input products, the outputs products are n SAR intensity maps, (n-1) ternary change maps and (n-1) red-blue change maps in GeoTIFF format, and (n-1) vector layers in KML format. The output intensity maps have been cropped, fine registered, speckle filtered, geocoded and converted to 1-band 8-bit format for straightforward visualization. The change maps are formed by ratioing consecutive radar intensity images (image1/image2) and thresholding according to the db_threshold parameter. If the morpho_size parameter is set, a morphological operator is applied to remove small areas of change to reduce false alarms. In the ternary change map, areas with no change above the threshold are set to 0, while areas with a positive log-ratio (image1 > image2) are set to 1 and areas with a negative log-ratio (image1 < image2) are set to -1. The red-blue change maps are provided to visualize the ternary maps with added context from the SAR intensity images. In the red-blue change maps, red areas indicate a large decrease in backscatter and blue areas indicate a large increase in backscatter between image acquisitions. Changes are overlaid on a grayscale radar intensity background image formed from max(image1, image2).The outputs are geocoded change maps in 3-band RGB 8-bit format. The change polygons are created by vectorizing the ternary change maps. As for the red-blue change maps, red polygons indicate a decrease in backscatter and blue areas indicate an increase in backscatter between image acquisitions. The following table describes some of the properties of the output products. All raster images are geocoded to the Universal Transverse Mercator (UTM) coordinate system. The vector products are given in geographic latitude and longitude coordinates. The following table describes some of the properties of the output products. All images are geocoded to the Universal Transverse Mercator (UTM) coordinate system. *Table 3 Properties of the Output Products* **Name** | **Coordinate System** | **Band** **Grouping** | **Data** **Type** | **Description** | --- | --- | --- | --- | --- RS2&#95;<BeamMode>&#95;<Pol>&#95;<Date&Time>&#95;<crop>&#95;<lut_type>&#95;<reg/REG>&#95;<filter&#95;type>&#95;geo&#95;viz8|UTMWGS84 | 1-Band | 8-bit Unsigned Byte | Intensity map RS2&#95;<BeamMode>&#95;<Pol>&#95;<MasterDate&Time>&#95;<SlaveDate&Time>&#95;<filter_type>&#95;ar&#95;geo&#95;ternary |UTMWGS84 | 1-Band | 32-bit Float | Ternary change map (values of -1, 0,1) RS2&#95;<BeamMode>&#95;<Pol>&#95;<MasterDate&Time>&#95;<SlaveDate&Time>&#95;<filter_type>&#95;ar&#95;geo&#95;RBmap | UTM WGS84 | 3-Band (R,G,B) | 8-bit Unsigned Byte | Red-blue change map RS2&#95;<BeamMode>&#95;<Pol>&#95;<MasterDate&Time>&#95;<SlaveDate&Time>&#95;<filter_type>&#95;ar&#95;geo&#95;ternary&#95;vector&#95;<vector&#95;min&#95;short&#95;edge >&#95;< vector&#95;min&#95;long&#95;edge>.kml | Geographic WGS84 | N/A | Vector KML | Vectorized change polygons Where: <BeamMode> = RADARSAT-2 beam mode of acquisition (e.g. ‘XFW03’) <Pol> = Polarization (e.g. ‘HH’) <Date&Time> = 8 character date and 6 character UTC time of image acquisition in the format ‘YYYYMMDD_HHMMSS’ (YearMonthDay_HoursMinutesSeconds) <crop> = ‘crop’ if input parameter *crop_images* = ‘true’, otherwise omitted <lut_type> = input parameter *lut_type* (e.g. ‘sigma’) <reg/REG> = ‘reg’ for all scenes except the registration master scene which is denoted ‘REG’ <filter_type> = ‘box#x#’, ‘lee#’ or ‘mt#’ depending on input parameter *filter_type*, where # = input parameter *filter_size*, (e.g. ‘mt13’) < vector_min_short_edge >= Set according to *parameter vectorization_min_short_edge* < vector_min_long_edge >= Set according to *parameter vectorization_min_long_edge* The output product names will depend on the input parameters and the image products input to the task including acquisition beam mode, polarization, and dates and times. The following example lists the output directories from the AWS Command Line Interface (CLI) after running the task with default settings for a stack of 6 images. [block:code] { "codes": [ { "code": ">> aws s3 ls s3://gbd-customer-data/<customer_bucket_name>/demo_end2end/\nPRE RS2_XF0W3_HH_20160326_151945_20160419_151944_mt13_ar_geo_RBmap/\nPRE RS2_XF0W3_HH_20160326_151945_20160419_151944_mt13_ar_geo_ternary/\nPRE RS2_XF0W3_HH_20160419_151944_20160513_151943_mt13_ar_geo_RBmap/\nPRE RS2_XF0W3_HH_20160419_151944_20160513_151943_mt13_ar_geo_ternary/\nPRE RS2_XF0W3_HH_20160513_151943_20160606_151942_mt13_ar_geo_RBmap/\nPRE RS2_XF0W3_HH_20160513_151943_20160606_151942_mt13_ar_geo_ternary/\nPRE RS2_XF0W3_HH_20160606_151942_20160630_151941_mt13_ar_geo_RBmap/\nPRE RS2_XF0W3_HH_20160606_151942_20160630_151941_mt13_ar_geo_ternary/\nPRE RS2_XF0W3_HH_20160630_151941_20160724_151940_mt13_ar_geo_RBmap/\nPRE RS2_XF0W3_HH_20160630_151941_20160724_151940_mt13_ar_geo_ternary/\nPRE RS2_XF0W3_HH_SGF_20160326_151945_crop_sigma_REG_mt13_geo_viz8b/\nPRE RS2_XF0W3_HH_SGF_20160419_151944_crop_sigma_reg_mt13_geo_viz8b/\nPRE RS2_XF0W3_HH_SGF_20160513_151943_crop_sigma_reg_mt13_geo_viz8b/\nPRE RS2_XF0W3_HH_SGF_20160606_151942_crop_sigma_reg_mt13_geo_viz8b/\nPRE RS2_XF0W3_HH_SGF_20160630_151941_crop_sigma_reg_mt13_geo_viz8b/\nPRE RS2_XF0W3_HH_SGF_20160724_151940_crop_sigma_reg_mt13_geo_viz8b/\n2017-07-27 17:27:21 519474 RS2_XF0W3_HH_20160326_151945_20160419_151944_mt13_ar_geo_ternary_vector_1_1.kml\n2017-07-27 17:27:21 2889592 RS2_XF0W3_HH_20160419_151944_20160513_151943_mt13_ar_geo_ternary_vector_1_1.kml\n2017-07-27 17:27:21 698577 RS2_XF0W3_HH_20160513_151943_20160606_151942_mt13_ar_geo_ternary_vector_1_1.kml\n2017-07-27 17:27:21 214303 RS2_XF0W3_HH_20160606_151942_20160630_151941_mt13_ar_geo_ternary_vector_1_1.kml\n2017-07-27 17:27:21 211951 RS2_XF0W3_HH_20160630_151941_20160724_151940_mt13_ar_geo_ternary_vector_1_1.kml\n", "language": "text" } ] } [/block] The following three boxes list the contents of the first red-blue change map directory, the first ternary map directory, and the first radar intensity directory from the AWS CLI, respectively. ### first red-blue change map directory contents [block:code] { "codes": [ { "code": ">> aws s3 ls s3://gbd-customer-data/<customer_bucket_name>/demo_end2end/RS2_XF0W3_HH_20160326_151945_20160419_151944_mt13_ar_geo_RBmap/ --human-readable\n\n2017-07-27 17:27:23 255.2 KiB BrowseImage.tif\n2017-07-27 17:27:23 47.2 KiB LI-11525-12 RS2 EULA_Single User_V1-9_15JUN2011_ENGLISH.pdf\n2017-07-27 17:27:22 810.1 MiB RS2_XF0W3_HH_20160326_151945_20160419_151944_mt13_ar_geo_ternary.tif\n2017-07-27 17:27:23 3.6 KiB erpHistory.xml\n2017-07-27 17:27:23 328.2 KiB input_product.xml\n2017-07-27 17:27:23 328.1 KiB input_slaveProduct.xml\n2017-07-27 17:27:24 488.2 KiB lutBeta.xml\n2017-07-27 17:27:36 488.2 KiB lutGamma.xml\n2017-07-27 17:27:23 488.2 KiB lutSigma.xml\n2017-07-27 17:27:23 3.6 KiB product.kml\n2017-07-27 17:27:23 358 Bytes readme.txt\n2017-07-27 17:27:23 2.4 KiB rpc.xml\n", "language": "text" } ] } [/block] ### first ternary map directory content [block:code] { "codes": [ { "code": ">> aws s3 ls s3://gbd-customer-data/<customer_bucket_name>/demo_end2end/RS2_XF0W3_HH_20160326_151945_20160419_151944_mt13_ar_geo_ternary/ --human-readable\n\n2017-07-27 17:27:23 255.2 KiB BrowseImage.tif\n2017-07-27 17:27:23 47.2 KiB LI-11525-12 RS2 EULA_Single User_V1-9_15JUN2011_ENGLISH.pdf\n2017-07-27 17:27:22 810.1 MiB RS2_XF0W3_HH_20160326_151945_20160419_151944_mt13_ar_geo_ternary.tif\n2017-07-27 17:27:23 3.6 KiB erpHistory.xml\n2017-07-27 17:27:23 328.2 KiB input_product.xml\n2017-07-27 17:27:23 328.1 KiB input_slaveProduct.xml\n2017-07-27 17:27:24 488.2 KiB lutBeta.xml\n2017-07-27 17:27:36 488.2 KiB lutGamma.xml\n2017-07-27 17:27:23 488.2 KiB lutSigma.xml\n2017-07-27 17:27:23 3.6 KiB product.kml\n2017-07-27 17:27:23 358 Bytes readme.txt\n2017-07-27 17:27:23 2.4 KiB rpc.xml\n", "language": "text" } ] } [/block] ### first radar intensity directory contents [block:code] { "codes": [ { "code": ">> aws s3 ls s3://gbd-customer-data/<customer_bucket_name>/demo_end2end/RS2_XF0W3_HH_SGF_20160326_151945_crop_sigma_REG_mt13_geo_viz8b/ --human-readable\n\n2017-07-27 17:27:21 255.2 KiB BrowseImage.tif\n2017-07-27 17:27:21 47.2 KiB LI-11525-12 RS2 EULA_Single User_V1-9_15JUN2011_ENGLISH.pdf\n2017-07-27 17:27:21 202.5 MiB RS2_XF0W3_HH_SGF_20160326_151945_crop_sigma_REG_mt13_geo_viz8b.tif\n2017-07-27 17:27:21 1.7 KiB erpHistory.xml\n2017-07-27 17:27:21 328.2 KiB input_product.xml\n2017-07-27 17:27:20 488.2 KiB lutBeta.xml\n2017-07-27 17:27:22 488.2 KiB lutGamma.xml\n2017-07-27 17:27:21 488.2 KiB lutSigma.xml\n2017-07-27 17:27:21 3.6 KiB product.kml\n2017-07-27 17:27:21 358 Bytes readme.txt\n2017-07-27 17:27:21 2.4 KiB rpc.xml\n", "language": "text" } ] } [/block] *Table 4 GeoTIFF intensity map of type UINT8x1. The data will be displayed using the following color codes:* | **Color** | **Value** | **Class Description** | | --- | --- | --- | | Black | 0 | Intensity given by lower bound of scale\_value | | Gray | 1 – 254 | Intensity between upper and lower bounds of scale\_value | | White | 255 | Intensity given by upper bound of scale\_value | *Table 5 GeoTIFF ternary change map of type FLOAT. The data are assigned using the following values:* | **Value **| **Class Description** | | --- | --- | | -1 | Negative log-ratio of image1/image2 above db_threshold. i.e. Strong increase in backscatter between image1 and image2 | 1 | Positive log-ratio of image1/image2 above db_threshold i.e. Strong decrease in backscatter between image1 and image2 | | 0 | No change above threshold | *Table 6 GeoTIFF red-blue change map of type UINT8x3. The data will be displayed using the following color codes (if saturate_flag = ‘true’; if saturate_flag = ‘false’ red and blue values are scaled by the radar intensity of each pixel):* | **Color** | **RGB Value** | **Class Description** | | --- | --- | --- | | Red | [255,0,0] | &quot;Red is Fled&quot; – Strong decrease in backscatter between image1 and image2 | | Blue | [0,0,255] | &quot;Blue is new&quot; – Strong increase in backscatter between image1 and image2 | | Grayscale | [x, x, x] for 0 ≤ x ≤ 255 | Radar intensity background | Note that the images are padded with NaN (not a number) values after geocoding in locations where no information exists. ## <a name="Advanced Options"></a>Advanced Options The task parameters can be set in various combinations to detect different types of changes and to effectively visualize the changes. ### General guidelines • **scale_value**: Default scaling of the background intensity image between -20 and 0 decibels is a good starting point for many co-polarized (HH or VV) SAR products. However these bounds may not be appropriate for all land covers and applications and can be iteratively refined by trial-and-error. If users would like to brighten the background over very smooth surfaces they can lower the scaling bounds (e.g. [-25 -5] dB) or for very bright areas such as urban environments they can raise the scaling bounds (e.g. [-15 5] dB). • **morpho_size**: By default no morphological operator is applied after thresholding. However this parameter may be set to remove objects smaller than a specified size, given in pixels. Removing small objects is recommended to make the change map less cluttered and easier to analyze visually. A size of at least 2 to 3 pixels can be used to remove isolated pixels. • **vectorization_min_short_edge and vectorization_min_long_edge**: By default all changes in the ternary map (after applying morphological operators) are vectorized, and the minimum short and long edge vector lengths are 1x1 pixels. These parameters can be increased if users know the minimum size of the changes of interest in each dimension. Users can set the minimum short and long edge sizes separately to detect changes that are narrow in one dimension (e.g. rectangular features such as extended buildings, road construction, etc.). This parameter can also be set if users want see all changes in the ternary map, but only want to keep vectorized change polygons of larger changes. ### Large Man-made Target Changes The default parameters are already optimized to detect large man-made targets such as ships, aircraft and large vehicles. However the following parameters may be varied to improve detection and visualization performance in certain conditions: • **db_threshold**: The default value of ±7 dB generally yields reasonable results to detect changes for man-made objects. However this threshold can be increased (e.g. to ± 8 or ±9 dB) to isolate especially bright changes and thereby remove extraneous changes. However if set too high, targets of interest may be missed. • **morpho_size**: If the minimum size of the target(s) of interest are known, the morphological operator size may be set to isolate the changes of interest. To determine the morphological operator size, users can divide the area of the smallest object they are interested in by the pixel area. RADARSAT-2 XF data with SGF 1-look product type have a pixel spacing of 3.13 x 3.13 m. For instance, to detect a large transport vehicle of size ~20 m x 3 m = 60 m<sup>2</sup>, one could apply a morphological operator of ~ 60 m<sup>2</sup> / (3.13 m)<sup>2</sup> 6 pixels. • **vectorization_min_short_edge and vectorization_min_long_edge:** if users would like to reduce the number of vectorized change polygons, they can eliminate smaller polygons by increasing the minimum short and long edge parameters. • **scale_value**: The same recommendations apply as stated in the general guidelines, although if users would like to see additional detail in the intensity images over bright targets of interest, they may choose very high scaling bounds (e.g. [-5 20] dB for bright ships), although this will significantly reduce the contrast of the background image. ### Urban Area Change Detection • **db_threshold**: Although in most cases a symmetric threshold gives reasonable results for change detection, sometimes asymmetric thresholds can be more appropriate. For example, if a new building has been built alongside new roads, the high intensity change (building) should be detected as new (blue/negative change) and the dim intensity change (roads) should be detected as fled (red/positive change) when taking the logarithmic difference of image1 – image2. In such a case, asymmetric threshold values, for instance, and (db_threshold = [-8 1]) would detect more of the changes of interest. ##<a name="Known Issues"></a>Known Issues • Due to limits on disk space available per task, a maximum of 9 full-size XF images with SGF 1-look product type can be processed in a single task. If users crop images, then thicker stacks can be supported, where maximum stack size will depend on the size of the crop. • The algorithm does not perform well on small image crops (< 1000x1000 pixels or ~< 3x3 km for RADARSAT-2 XF data with SGF 1-look product type) due to issues registering the stack together. • The software has best results if overlap between all images in the stack (before cropping) is 90%. • The software has not been tested on images straddling the International Date Line. • The software works well using the ‘default’ GBDX domain, corresponding to AWS EC2 Instance r4.2xlarge. For processing stacks of full-size images (i.e. no cropping), additional time savings can be achieved using the r44xlarge or raid domains. The following GBDX domains should not be used: nvidiagpu, nvidiag2, t2medium. • The software has not been tested on filter sizes larger than 13x13 pixels. There could be memory and/or performance implications for larger filter sizes. • The output intensity and change map images have been geocoded using a Digital Elevation Model (DEM) supplied internally by GBDX. Inaccuracies in the DEM due to changes in the terrain since the DEM was acquired, the limited spatial resolution of the DEM, or man-made features such as buildings not included in the DEM can introduce artifacts and shifts in the location of the output pixels. #### Contact Us If you have any questions or issues with this task, please contact [**gbdx-support@digitalglobe.com** ](mailto:gbdx-support@digitalglobe.com).