当前位置:网站首页>MATLAB快速将影像的二维坐标转换为经纬度坐标
MATLAB快速将影像的二维坐标转换为经纬度坐标
2022-06-27 05:41:00 【A-Chin】
一般使用 [lat, lon] = pix2latlon(R,row,col) 逐个将影像的二维坐标转换为经纬度坐标,但这样用到双重循环,运行较慢,代码如下:
[A, RA] = readgeoraster('D:\test.tif');
info = geotiffinfo('D:\test.tif');
A_Lat = zeros(size(A));
A_Lon = zeros(size(A));
for i = 1 : size(A, 1)
for j = 1 : size(A, 2)
[A_Lat(i, j), A_Lon(i, j)] = pix2latlon(info.RefMatrix, i, j);
end
end
一种较快的方法为,先建立二维坐标的X矩阵和Y矩阵(代码中的A_I和A_J),然后仅需运行一次 pix2latlon 函数即可,运行效率能够大幅提高,代码如下:
[A, RA] = geotiffread('D:\test.tif');
info = geotiffinfo('D:\test.tif');
A_I = zeros(size(A));
A_J = zeros(size(A));
for i = 1 : size(A_I, 1)
A_I(i, :) = i;
end
for j = 1 : size(A_J, 2)
A_J(:, j) = j;
end
[A_Lat, A_Lon] = pix2latlon(info.RefMatrix, A_I, A_J);
边栏推荐
- Netease cloud music params and encseckey parameter generation code
- Web3 has not been implemented yet, web5 suddenly appears!
- Neon optimization 1: how to optimize software performance and reduce power consumption?
- IAR Systems全面支持芯驰科技9系列芯片
- Spark 之 Projection
- Database - index
- [FPGA] UART serial port_ V1.1
- EPICS记录参考5 -- 数组模拟输入记录Array Analog Input (aai)
- Opencv implements object tracking
- 《数据库原理与应用》第一版 马春梅……编著 期末复习笔记
猜你喜欢

What is BFC? What's the usage?
![[FPGA] design and implementation of frequency division and doubling based on FPGA](/img/84/75d473d3d8e670260ba16d06705c2f.png)
[FPGA] design and implementation of frequency division and doubling based on FPGA

Go日志-Uber开源库zap使用

Two position relay xjls-8g/220

导航【机器学习】

Double position relay jdp-1440/dc110v

LeetCode-515. 在每个树行中找最大值

Codeforces Round #802 (Div. 2)

Web3 has not been implemented yet, web5 suddenly appears!

重映像(STM32)
随机推荐
Webrtc Series - Network Transport 7 - ice Supplement nominations and ice Modèle
洛谷P4683 [IOI2008] Type Printer 题解
Dual position relay dls-34a dc0.5a 220VDC
stm32读取IO高低电平状态
Unity中跨平臺獲取系統音量
What is BFC? What's the usage?
IP网络通信的单播、组播和广播
30个单片机常见问题及解决办法!
QT using Valgrind to analyze memory leaks
Redis high availability cluster (sentry, cluster)
双位置继电器HJWS-9440
代码即数据
Niuke practice 101-c reasoning clown - bit operation + thinking
多线程基础部分Part3
mysql 查询时将状态改为相对应的文字
Execution rules of pytest framework
Web3 has not been implemented yet, web5 suddenly appears!
机械转码日记【17】模板,STL简介
【Cocos Creator 3.5.1】event.getButton()的使用
Senior [Software Test Engineer] learning route and necessary knowledge points