torchgeo icon indicating copy to clipboard operation
torchgeo copied to clipboard

How to fetch the same areas from image product?

Open TolgaAktas opened this issue 2 years ago • 3 comments

Issue

Working with Landsat 8 data, I will have a variety of products that corresponding to similar or different scenes based row/path designation. In my research project, I am trying to figure out a convenient way to obtain a collection of images that exactly math the same area of interest pixel by pixel. For example, I will need to combine a collection of images for the same area, sorting by cloud cover ratio), but the pixel coordinates in all images need to match to the correct area.

I am able to instantiate Landsat8 dataset object with my dataset root path, but I realize that the sampling of the dataset is not necessarily index based but by bounding box based. Not sure how to utilize this, but for my training loop, how can I make sure that from my Landsat8 dataset object, I can fetch the correct pairs/tuples of images?

Fix

No response

TolgaAktas avatar Jan 31 '23 02:01 TolgaAktas

Hi @TolgaAktas, just to make sure I'm understanding correctly, you have a bunch of data that overlaps the same spatial area, but at different points in time, and you want to sample temporal stacks of data from these overlaps? If so, some more questions:

  • Will the number of time steps always be the same?
  • Are you actually trying to train deep learning models with this data? If not, then some other tools like stackstac combined with the Planetary Computer might be more appropriate (e.g. https://github.com/microsoft/PlanetaryComputerExamples/blob/main/tutorials/cloudless-mosaic-sentinel2.ipynb)
  • What shape do you expect the extracted samples to be?

It sounds like you might need a RandomSpaceTimeSampler or something.

calebrob6 avatar Jan 31 '23 03:01 calebrob6

Basically I am trying to design machine learning experiments in which I am:

  1. Trying to create pairs of satellite images with different cloud cover ratios, of the same area. So the pixels need to be aligned.

  2. Trying to create positive, anchor, negative samples for contrastive learning.

  3. Trying to create a cloud_cover-sorted collection of images, which will be part of the machine learning training.

So the images for positive samples or x-y mapping need to be pixel-aligned, whereas for negative samples, not so much. I don't really need temporality in the data, but I need to provide data in an descending cloud_cover order.

TolgaAktas avatar Jan 31 '23 19:01 TolgaAktas