Pixel Value according to location

Hello I have posted this question before at:
https://www.mathworks.com/matlabcentral/answers/369563-extracting-the-values-of-pixel-at-certain-points?s_tid=prof_contriblnk
I'm very lost in what I have to do, below is my question:
I have a large raster layer that has aridity values assigned to each pixel. I also have latitude and longitude data of some locations in USA. I would like to know the pixel value according to my latitude and longitude locations . I first clipped the raster to my area of interest (USA) in Arcmap the I converted my clipped raster in to a .tif file then I did the following, where i convert these pixels into lat and lon but I am having problems finishing the code. I'm not sure what to do. Or is there a different approach. Any suggestions?
I = imread('ai_yr1.tif');
info = geotiffinfo('ai_yr1.tif');
height = info.Height; % Integer indicating the height of the image in pixels
width = info.Width; % Integer indicating the width of the image in pixels
[rows,cols] = meshgrid(1:height,1:width);
[ADlat,ADlon] = pix2latlon(info.RefMatrix, rows, cols);
I unfortunately can't attach my .tif file but I have attached a picture to give an idea of what I have
Thank You!!

댓글 수: 3

Walter Roberson
Walter Roberson 2017년 11월 28일
We were waiting for your file to be attached; you should merge this question with your original at https://www.mathworks.com/matlabcentral/answers/369563-extracting-the-values-of-pixel-at-certain-points
KSSV
KSSV 2017년 11월 29일
IF you have geotiff file in hand..it means you have all the information in hand...what problem you are facing?
Mariam Salem
Mariam Salem 2017년 11월 29일
I wanted to know the pixel value at specific latitudes and longitudes, I have posted a dropbox link at my original question:
https://www.mathworks.com/matlabcentral/answers/369563-extracting-the-values-of-pixel-at-certain-points?s_tid=prof_contriblnk

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

질문:

2017년 11월 28일

편집:

2017년 11월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by