Recolouring Sentinel2 multispectral image
이전 댓글 표시
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
Subhadeep Koley
2020년 1월 22일
Can you share your netCDF4-BEAM file? or any other example netCDF4-BEAM file, which has the same dimension as yours.
Aidan Wood
2020년 1월 23일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Waveform Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



