Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out small imagery? #183

Closed
dbuscombe-usgs opened this issue Aug 22, 2023 · 3 comments
Closed

Filter out small imagery? #183

dbuscombe-usgs opened this issue Aug 22, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@dbuscombe-usgs
Copy link
Member

Often, partial images are downloaded, which are subsamples of the ROI we requested

This is potentially problematic for 2 reasons;

  1. the image segmentation algorithm is likely to fail on tiny subsets of ROI imagery
  2. The partial images are unlikely to be useful for extensive shoreline extraction anyway, because more often than not, the portion of imagery capturing the shoreline region is absent

A rudimentary filter of non-modal image shapes was implemented here
#154

It reads in every image (could use Dask), and makes a list of image shapes. Non-modal shapes are thrown out. This would fail for short time-series of images, so a better approach would be as follows;

  1. compute area of ROI (I think this is already done with existing coastseg implementation)
  2. compute ROI of downloaded image (number of pixels x pixel size, e.g. 10m for S2, 15m for L7, L8, L9, and 30m for L5)
  3. if the two numbers are not the same, throw the image out
@2320sharon
Copy link
Collaborator

Move these files into a bad folder.

  1. mkdir bad
  2. Find all the too small images
  3. Move them to the bad folder

@2320sharon 2320sharon added the V1 Version 1 of Coastseg label Aug 24, 2023
@2320sharon 2320sharon removed the V1 Version 1 of Coastseg label Aug 31, 2023
2320sharon added a commit that referenced this issue Sep 26, 2023
@2320sharon
Copy link
Collaborator

2320sharon commented Sep 28, 2023

Users want the controls for this to be a simple on/off switch that by default filters out imagery that's less than 80% of the expected ROI area. This control should be on by default.

Users are also interested in understanding how these partial images happen, maybe its a GEE clipping issue?

  • Implement the new control

  • Identify a region that contains partial imagery and manually create a GEE query to see if you get the same clipping issue.

  • @dbuscombe-usgs check the source imagery to check if this issue is a result of the ROI being on the edge of the swath of image the plane flew through ( I can't remember the technical term for this)

image

@2320sharon
Copy link
Collaborator

This feature has been implemented in coastseg 1.1.0.dev5.

ChangeLog

  1. Add a new checkbox located under settings that controls if filter images is set to on/off
    image

  2. Modified the minimum default value for filtering the images to be 60% of the ROI area

  3. Added new functions

  • filter_partial_images
  • filter_images
  • filter_images_by_roi
  1. Added tests for the following functions
  • filter_partial_images
  • get_roi_area
  • filter_images
  • get_most_accurate_epsg
  • convert_wgs_to_utm
  • get_epsg_from_geometry
  1. Went from 116 tests to 133 automated tests

Installation

pip install coastseg==1.1.0.dev5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants