Extract spatial data using shp file as a mask
Show older comments
I'm new in matlab
So I tried to extract pixel data from a modis bands image with point as a central for 5x5 box.
So the 5x5 box will be filled with modis image's pixel.

I already did it in qgis, but it failed.
The yellow dot contains lattitude, longitude and target data.
Is there any refrence to do this? I already read some examples, but they are only using the box (shp file) to fill it.
For future works, I want to generate 4D data [n,x,y,t]
n = for band's modis image
x,y = box
t = data target
6 Comments
yanqi liu
on 19 Dec 2021
yes,sir,which is the image process target? get the yellow point location?
Image Analyst
on 19 Dec 2021
What is qgis, and did you do it there? Or did it fail there?
What/where exactly is "the box"? Is it the rectangular region where the 4 yellow dots define the corners?
I'm not sure what n is. Is this image not gray scale but maybe multispectral with several wavelength bands?
I don't know what t (the "data target") is. Is it the gray level?
I don't know what the 4-D data would be. So, let's say n=1, x=2, y=55, and t = 163. What would the value at your output array output(1, 2, 55, 163) represent? What goes into that location of the 4-D array?
Fadhurrahman
on 20 Dec 2021
Edited: Fadhurrahman
on 20 Dec 2021
Walter Roberson
on 20 Dec 2021
Depending on the details of your situation, the code at https://www.mathworks.com/matlabcentral/answers/1608670-how-to-process-nc-file-in-matlab#comment_1890080 might help.
Fadhurrahman
on 20 Dec 2021
Fadhurrahman
on 23 Dec 2021
Answers (0)
Categories
Find more on Contrast Adjustment in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!