Recolouring Sentinel2 multispectral image
Mostrar comentarios más antiguos
Hello,
I am trying to recolour an image composed of the red, green and blue channels of Sentinel 2 imagery (Bands 4, 3 and 2, respectively). I have processed this imagery in the SNAP toolbox and exported in netCDF4-BEAM format.
Firstly, I read in the required image bands and create the RGB image:
address = %file location on computer;
ncid = netcdf.open(address);
bands{1} = transpose(im2double(netcdf.getVar(ncid,4))); %Red channel
bands{2} = transpose(im2double(netcdf.getVar(ncid,3))); %Green channel
bands{3} = transpose(im2double(netcdf.getVar(ncid,2))); %Blue channel
Image = cat(3,bands{1},bands{2},bands{3}); %RGB image, datatype of double
When I try to visualise the image with imshow(Image), the result is near monochromatic. I understand this is due to correlation between channels and so I wish to recolour the image.
What is the best way to do this?
I have tried to use the code below, however this makes no difference:
stretchedImage = imadjust(Image,stretchlim(Image));
I have also investigated the image histograms however I don't understand why there is a difference between histogram(Image) and imhist(Image). I think the differences in the outputs of these may be related to my issues with strethlim, hopefully you can help shine a light on this for me!
Many thanks.
2 comentarios
Subhadeep Koley
el 22 de En. de 2020
Can you share your netCDF4-BEAM file? or any other example netCDF4-BEAM file, which has the same dimension as yours.
Aidan Wood
el 23 de En. de 2020
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Timing and presenting 2D and 3D stimuli en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



