Dear Matlab community, I am given the number of pixels as 768 by 768 for a TIFF image and I am required to convert it to x and y geographical coordinates
2 ビュー (過去 30 日間)
古いコメントを表示
I have treid all the referenced past examples but none works with my case.
2 件のコメント
Voss
2022 年 12 月 26 日
Please upload (using the button with the paperclip icon on it) your image and the code you have tried so far.
回答 (1 件)
Nadia Shaik
2023 年 3 月 10 日
Hi Rukundo,
I understand that you wish to convert the pixel coordinates to geographic coordinates. Below are a few changes you can consider:
- when you use "meshgrid", the first input should be the width (i.e., the number of columns) and the second input should be the height (i.e., the number of rows):
[W, H] = meshgrid(1:width, 1:height);
- You can use the "geotiffread" function instead of "imread" to read in the "TIFF" file. This will give you both the image data (I) and the R structure, which contains the georeferencing information.
[I, R] = geotiffread('xp.tiff');
Hope this helps!
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!