How to read arbitrary pixel values from a geotiff image?
3 ビュー (過去 30 日間)
古いコメントを表示
Hi
I'm looking for a function to read values from a geotiff image for an array of arbitrary lat,lon coordinates.
Something like this:
val = pixtiffread(filename,lat,lon,refmat)
imread for tiff images lets you specify a pixelreagion but I can't find a function that takes lat and lon vectors.
Any help would be appreciated. Regards Neil
0 件のコメント
採用された回答
Image Analyst
2012 年 5 月 6 日
The help for imread says: "'PixelRegion': Cell array, {Rows, Cols}, specifying the boundaries of the region. Rows and Cols must be either two- or three-element vectors. If you specify two elements, the values denote the 1-based indices [start stop]. If you specify three elements, the values denote the 1-based indices [start increment stop], to allow image downsampling."
So why can't you use that? Just have x by the columns, and y be the rows? Or else why can't you just read in the whole image and extract the values like pixelValue = yourImage(y, x), where you do that for each x and y that you have?
3 件のコメント
Image Analyst
2012 年 5 月 7 日
How big is your image? Can you sort your x and y points into where they would lie if you divided your image up into, say, 10 by 10 blocks? Then you can read in one block at a time, read pixel values for the coordinates that lie in that block, and do this for every block of the image.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!