How to map sentinel 2 pixel values into lat and long

28 vues (au cours des 30 derniers jours)
Erin Browne
Erin Browne le 1 Mar 2019
Hi all,
I am looking assinging the pixel values which are in row, column format on my Sentinel 2 imagery when I upload it to matlab. Each pixel has a value in which i divide by 10,000 in order to get the remote sensing reflectance.
I have ground truth data which I need to put out the values of the specific pixels it corresponds to in the sentinel 2 image. The ground truth data I have as 5 sites with a latitude and longitude. But the sentinel image is a flat tile so therefore even taking the corners of the image, subtracting and dividing by the number of pixels did not work as the curvature of the earth is not accounted for the the flat tile.
Would anyone know how to assign each pixel/sentinel image accurate co-ordinates in the form of latitude and longitude in order for me then to pull out the pixel values from the sentinel 2 image to compare them with the ground truth data at those corresponding five sites.
Thank you!

Réponses (4)

Image Analyst
Image Analyst le 2 Mar 2019
Not sure. Call the sales department or technical support and ask if the mapping toolbox has that capability - where it can get lat and lon taking the earth's curvature into account.

Jeff
Jeff le 9 Juin 2019
I'm also looking to extract data from S2 imagery, but it's a little trickier with the Sentinel-2 format. I don't have a solution yet, but if you're in a hurry you could always check out the free ESA Sentinel-2 toolbox. It will allow you to extract the imagery data for a given lat and lon.
https://step.esa.int/main/toolboxes/sentinel-2-toolbox/

Hernán Aguilera
Hernán Aguilera le 17 Oct 2019
Modifié(e) : Hernán Aguilera le 17 Oct 2019
Hi, I use the metadata where the edge values in lat and long come, then I build a georeference file to determine the pixel coordinates.
row 'EXT_POS_LIST' in metadata from S2, extract georeference.
R = maprasterref();
R.XWorldLimits = LatitudeLimits;
R.YWorldLimits = LongitudeLimits;
regards!

Iskander Benhadj
Iskander Benhadj le 23 Mar 2020
Modifié(e) : Iskander Benhadj le 23 Mar 2020
Dear all,
to help you, I need to know what type of Sentinel 2 images you are working with. If you are using the Sentinel2 L1C or L2A, then it is already georeferenced images and can be easliy read by any GIS software. In matlab, you need to read the upper left corner of the image and add/substract the (dx,dy) step in meter respectevely in column and row directions.
Note the coordinates of Sentinel 2 pixels is expressed in Universal Transverse Mercator coordinate system
e.g if you want to get the lat, lon of pixel (i,j)
x_utm = x_upper_left_corner + i*dx;
y_utm = y_upper_left_corner - j*dy
(dx,dy) can be 10m, 20m and 60m depending on the S2 spectral bands you are processing
then convert (x_utm, y_utm) into (lat,lon)
Best Regards,
Iskander

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by