How to use the consolidator function for interpolation of images?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I have two images, one with spatial resolution of 12 km (EASEGrid dataset for sea ice age) and another of 10 m (Sentinel 2B). I want to interpolate the sentinel 2B image to EASEGrid image. I found a function called 'consolidator'. However, I am not sure how to go forward with it.
I tried the below code but its not working. Please suggest how it could be corrected or if any other methods are available.
SE2_folder = '/Users/anweshasharma/Documents/MATLAB/Remote_sensing/code/sea_ice_type/ice_age_ncfile';
info_10m = geotiffinfo([SE2_folder, '/' 'iceage_nh_12.5km_19840101_19841231_v4.1_1984-03-25.tif']);
[easting_vec, northing_vec, info_10m] = geotiffread([SE2_folder, '/' 'iceage_nh_12.5km_19840101_19841231_v4.1_1984-03-25.tif']);
%% Extract geographic positions of image pixels% Make an array of rows and columns (i.e pixel locations)
[easting_grid, northing_grid] = meshgrid(easting_vec, northing_vec);
% - from projected map coordinates to latitude and longitude
[lat, lon] = projinv(info_10m, easting_grid, northing_grid);
%consolidator function
[xcon, ycon] = consolidator13(lat, lon, 'mean', 0, absolute);
SE2_folder_1 = '/Users/anweshasharma/Documents/MATLAB/Remote_sensing/S2B_MSIL1C_20200630T142749_N0209_R139_T29XMJ_20200630T144540.SAFE/GRANULE/L1C_T29XMJ_A017325_20200630T142745/IMG_DATA';
%A = readgeoraster('true_color1.tif');
%A = im2double(A);
info_10m1 = geotiffinfo([SE2_folder_1, '/' 'T29XMJ_20200630T142749_B08.tif']);
[easting_vec1, northing_vec1, info_10m1] = geotiffread([SE2_folder_1, '/' 'T29XMJ_20200630T142749_B08.tif']);
[easting_grid1, northing_grid1] = meshgrid(easting_vec1, northing_vec1);
[lat1, lon1] = projinv(info_10m1, easting_grid1, northing_grid1);
class_A = class(A);
for channel = size(A,3): -1:-1
newImage = (:,:,channel) = interp2(lat1,lon1, A(:,:,channel),xcon,ycon,
'linear');
end
imshow(newImage)
2 Kommentare
John D'Errico
am 22 Mär. 2021
Why would you use consolidator to do image interpolation? You won't have replicate points. So why do you think you need it?
Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!