Skip to content

Commit

Permalink
#260 add doctree to how to filter out bad imagery and link guide in c…
Browse files Browse the repository at this point in the history
…ase study 2. Explain with more detail how downloaded data is loaded to extract shorelines in the getting started guide and extract shorelines guide
  • Loading branch information
2320sharon committed Jun 18, 2024
1 parent c17d7a9 commit 5181aeb
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 25 deletions.
66 changes: 47 additions & 19 deletions docs/How-to-Filter-Out-Bad-Imagery.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,65 @@
# Filtering Imagery

Extracting the best shorelines requires that only the best imagery is used which means that bad imagery needs to be sorted out. You should filter out bad imagery in `data/roi_id/jpg_files/preprocessed/RGB` by moving any bad imagery to a designated subdirectory named 'bad'.

It is important to note that this operation does not delete any TIFF files, but rather helps to improve the efficiency of shoreline extraction and enhance the quality of the extracted shorelines. Check out the [wiki page about the shoreline extraction process](https://github.com/Doodleverse/CoastSeg/wiki/6.-How-to-Extract-Shorelines) for more information about how to extract shorelines.
To extract the best shorelines, it's essential to use only high-quality imagery, which means filtering out any poor-quality images. You should filter out bad imagery in `data/roi_id/jpg_files/preprocessed/RGB` by moving any undesirable images to a designated subdirectory named 'bad'.

## Step by Step Guide
Filtering the RGB images does not delete any TIFF files but helps to improve the efficiency of shoreline extraction and enhance the quality of the extracted shorelines. For more information on the shoreline extraction process, check out the [wiki page about the shoreline extraction process](https://github.com/Doodleverse/CoastSeg/wiki/6.-How-to-Extract-Shorelines).

### Before you begin

Download data with the `SDS_coastsat_classifier.ipynb` and make sure it downloaded to your `data` directory within coastseg
## Step-by-Step Guide

1. Open the `data` directory within coastseg
2. Navigate to the ROI directory
### Before You Begin

- If you're not sure which ROI directory you used for a particular session go to the `sessions` directory, click the session you are interested in and open the `config.json` file. Look for the variable `sitename` and the sitename will be in a format similar to `ID_yvk1_datetime06-05-23__07_07_42`. This is the name of the ROI directory containing the downloaded data in the `data` directory within coastseg
Download data with the `SDS_coastsat_classifier.ipynb` and ensure it is saved to your `data` directory within CoastSeg.

### Example config file from data
### 1. Open the `data` Directory

![config_json_example_screenshot_sitename_from_data](https://github.com/SatelliteShorelines/CoastSeg/assets/61564689/cc172608-895d-456b-8789-0725fb338805)
1. Navigate to the `data` directory within CoastSeg.
2. Click on the ROI directory you want to sort

### Example config file from sessions
In this example, you can see that ROI 3 is located within the `CoastSeg/data` folder. The `jpg_files > preprocessed > RGB` directory contains all the RGB imagery for all the satellites.

![config_json_sitename_from_session](https://github.com/SatelliteShorelines/CoastSeg/assets/61564689/45d2f48e-abe9-4dd7-bcd0-8253092c6613)
```
├── CoastSeg
|
|___data
| |_ ID_3_datetime11-22-22__11_15_15
│   | |_ L8
│   | |_ L9
│   | |_ S2
│   | |_ jpg_files
│   | | |_ preprocessed
| │   | | |_ RGB
| | │   | | |_ 2018-12-06-19-04-16_RGB_S2.jpg
| | │   | | |_ 2018-12-06-19-04-16_RGB_L8.jpg
| | │   | | |_ 2018-12-06-19-04-16_RGB_L9.jpg
| │   | | |_ NIR
| | │   | | |_ 2018-12-06-19-04-16_NIR_S2.jpg
| | │   | | |_ <rest of images...>
| │   | | |_ SWIR
| | │   | | |_ 2018-12-06-19-04-16_SWIR_S2.jpg
| | │   | | |_ <rest of images...>
│   | | |_detection
| │   | | |_<jpgs of detected shorelines>
│   | |_config.json
│   | |_config_gdf.json
│   | |_extracted_shorelines.geojson
```

3. In the ROI directory navigate to `jpg_files>preprocessed>RGB`

- Example on windows: `CoastSeg\data\ID_yvk1_datetime06-05-23__06_57_26\jpg_files\preprocessed\RGB`
### 2. Navigate to the RGB Directory

4. Remove the files the you don't like
1. Create a new subdirectory named 'bad' within the data/roi_id/jpg_files/preprocessed/RGB directory if it does not already exist.
2. Identify the files within the data/roi_id/jpg_files/preprocessed/RGB directory that you want to remove.
3. Copy the files you wish to remove and paste them into the 'bad' subdirectory created in step 1. - Confirm that the files are successfully copied to the 'bad' subdirectory.
1. Go to `jpg_files > preprocessed > RGB` within the ROI directory.
- Example on Windows: `CoastSeg\data\ID_yvk1_datetime06-05-23__06_57_26\jpg_files\preprocessed\RGB`

### 3. Move Bad Imagery

1. Create a subdirectory named 'bad' within the `data/roi_id/jpg_files/preprocessed/RGB` directory if it does not already exist.
2. Identify the images you want to remove.
3. Move these images to the 'bad' subdirectory.

![coastseg_screenshot_bad_subdir](https://github.com/SatelliteShorelines/CoastSeg/assets/61564689/f0423605-b8bc-4c1d-8eb2-c79be81e9a91)

5. Test the shoreline extraction process to verify that the removal of files from the `data/roi_id/jpg_files/preprocessed/RGB` directory has improved the efficiency and quality of the extracted shorelines. Check out the [wiki page about the shoreline extraction process](https://github.com/Doodleverse/CoastSeg/wiki/6.-How-to-Extract-Shorelines) for more information about how to extract shorelines.
### 4. Test Shoreline Extraction

Load your ROIs in CoastSeg and run `extract shorelines` again. None of the images that were sorted into the 'bad' directory will have their shorelines extracted. For more details, refer to the guide [How to Extract Shorelines](https://github.com/Doodleverse/CoastSeg/wiki/6.-How-to-Extract-Shorelines).
2 changes: 2 additions & 0 deletions docs/case_study_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ To get around this issue we have 2 options:

- You can see the ROI ID in the hover menu located to the top right of the map

- Read this quick [guide](https://satelliteshorelines.github.io/CoastSeg/How-to-Filter-Out-Bad-Imagery/) on how to filter bad imagery in CoastSeg.

**Sort out Images with Sea Ice**

- Sort any bad images into the 'bad folder'
Expand Down
4 changes: 2 additions & 2 deletions docs/extract_shorelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ If most of your imagery looks like these examples you may need to change your RO

## Step 4: Examine Shorelines Extracted from 3-5 years of imagery

- When you click extract shorelines a new directory with the session name you provided will be created at `CoastSeg/sessions`. It will contain a subdirectory for each ROI you selected and within each subdirectory will be all the files generated by extracting shorelines which are detailed in [Extracted Shoreline Session Contents](#extracted-shoreline-session-contents).
- When you click "Extract Shorelines," a new directory with the session name you provided will be created at `CoastSeg/sessions`. This directory will contain a subdirectory for each ROI you selected. Within each subdirectory, you will find all the files generated by extracting shorelines, which are detailed in [Extracted Shoreline Session Contents](#extracted-shoreline-session-contents).

- You can find images that show the extracted shoreline on each image in `coastseg/sessions/<YOUR SESSION NAME>/ROI_ID_NAME/jpg_files/detection` as shown below:
- You can find images that show the extracted shorelines on each image in `CoastSeg/sessions/<YOUR SESSION NAME>/ROI_ID_NAME/jpg_files/detection`. An example is shown below:

![coastseg/sessions/session/roi/jpg_files/detection](https://github.com/SatelliteShorelines/CoastSeg/assets/61564689/f5be75fb-1c75-46c2-bbec-b9b1e716fea4)

Expand Down
14 changes: 10 additions & 4 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,28 @@ jupyter lab SDS_coastsat_classifier.ipynb

- NEVER rename your ROIs. This is because CoastSeg keeps track of the filename in the 'config.json' and you won't be able to load it into CoastSeg again if you do. The ROI's ID is the filename, so that information will be lost if you rename it.

- The downloaded data can be found in `CoastSeg/data` under a folder with a name in the format `ID_<ROI ID>_datetime<currenttime>`. For example, you can see the JPGs for all the images you downloaded in `CoastSeg/data/ID_<ROI ID>_datetime06-17-24__11_12_40/jpg_files/preprocessed/RGB`.
- The downloaded data can be found in `CoastSeg/data` under a folder with a name in the format `ID_<ROI ID>_datetime<currenttime>`. For example, you can see the JPGs for all the images you downloaded in `CoastSeg/data/ID_<ROI ID>_datetime06-17-24__11_12_40/jpg_files/preprocessed/RGB`. You can read more on how ROIs are structured in this [guide](https://satelliteshorelines.github.io/CoastSeg/roi/)

- This is example of the RGB imagery from a downloaded ROI. Here you can see the user sorted some of the imagery into a bad folder so it would not be used to extract shorelines. A full tutorial on how to filter bad imagery is available [here](https://satelliteshorelines.github.io/CoastSeg/How-to-Filter-Out-Bad-Imagery/).
![coastseg/data/roi/](https://github.com/SatelliteShorelines/CoastSeg/assets/61564689/6f357c2e-8cdf-403d-8224-f8ba48946c2c)


![case_study_1_download_roi](https://github.com/SatelliteShorelines/CoastSeg/assets/61564689/1a30f9c7-fc4d-4e34-a57b-055624ff8464)




**10.Extract Shorelines**
![save_settings_download_extract](https://github.com/Doodleverse/CoastSeg/assets/61564689/3548a9ce-a190-4c95-b495-0ff75484fdb2)

- Extracting shorelines works by finding the land water interface in the image and drawing a line along it
- Extracting shorelines involves loading the ROI data for each selected ROI from `CoastSeg/data/<ROI ID>` and processing the downloaded rasters to extract shorelines. The resulting files are saved in `CoastSeg/sessions/<YOUR SESSION NAME>/ROI_ID_NAME` for each ROI. Note that the downloaded data is NOT copied to the session; instead, the `config.json` file in each session keeps track of the location of the downloaded ROI in `CoastSeg/data`. You can read more about what is in each session in this [guide]().


- Extracting shorelines works by finding the land water interface in the image and drawing a line along this boundary.

- A time series of shoreline position along each transect is generated as well.
- Additionally, a time series of shoreline positions along each transect is generated.

- You can find images that show the extracted shoreline on each image in `coastseg/sessions/<YOUR SESSION NAME>/ROI_ID_NAME/jpg_files/detection` as shown below:
- You can find images that show the extracted shoreline on each image in `CoastSeg/sessions/<YOUR SESSION NAME>/ROI_ID_NAME/jpg_files/detection` as illustrated below:

![coastseg/sessions/session/roi/jpg_files/detection](https://github.com/SatelliteShorelines/CoastSeg/assets/61564689/f5be75fb-1c75-46c2-bbec-b9b1e716fea4)

Expand Down

0 comments on commit 5181aeb

Please sign in to comment.