% function to plot lat/long/z from EXIF metadata of gps camera jpgs.
% updated for PAD data, and to include IR camera field
% NOTE: need to manually create .proj file
% updated 9/23/2019 EK for camera, not uav
%% i/o
clear; close all
% PAD 2019
% tablePath='F:\PAD2019\PAD_2019_Photos\output\csv\Pad19_photos.csv';
% shapePath='F:\PAD2019\PAD_2019_Photos\output\shp\Pad19_photos.shp';
% files=dir('F:\PAD2019\PAD_2019_Photos\*.jpg');
% %ABoVE 2017
% tablePath='D:\AboveData\FieldPhotos\out\csv\Above17_photos.csv';
% shapePath='D:\AboveData\FieldPhotos\out\shp\Above17_photos.shp';
% files=dir('D:\AboveData\FieldPhotos\ABoVE 2017 Fieldwork\*.jpg');
%ABoVE 2017- SC
% tablePath='D:\GoogleDrive\ABoVE top level folder\ABoVE_Field_Photos_for_Ethan\out\csv\Above17_photos_SC.csv';
% shapePath='D:\GoogleDrive\ABoVE top level folder\ABoVE_Field_Photos_for_Ethan\out\shp\Above17_photos_SC.shp';
% files=dir('D:\GoogleDrive\ABoVE top level folder\ABoVE_Field_Photos_for_Ethan\*.jpg');
%ABoVE 2019 - Clayton E
tablePath='F:\PAD2019\ClaytonElder\Collars\ek_csv\collar_photos19.csv';
shapePath='F:\PAD2019\ClaytonElder\Collars\ek_shp\collar_photos19.shp';
files=dir('F:\PAD2019\ClaytonElder\Collars\Pictures\*\*.jpg');
%% loop
i=1;
for n= 1:length(files)
path=[files(n).folder, '\', files(n).name];
if files(n).bytes > 300000
info=imfinfo(path);
if any(find(cell2mat(strfind(fieldnames(info), 'GPSInfo')))) && numel(fieldnames(info.GPSInfo)) >= 5
% numel(fieldnames(info)) >= 26
coords(i).lat=info.GPSInfo.GPSLatitude;
coords(i).lat=coords(i).lat(1)+coords(i).lat(2)/60+coords(i).lat(3)/3600;
coords(i).long=info.GPSInfo.GPSLongitude;
coords(i).long=-(coords(i).long(1)+coords(i).long(2)/60+coords(i).long(3)/3600);
try
coords(i).z=info.GPSInfo.GPSAltitude;
catch
coords(i).z=-9999
end
coords(i).filename=info.Filename;
try
coords(i).datetime=info.DateTime;
catch
coord(i).datetime='2019:01:01 00:00:00';
end
try
coords(i).cam=[info.Make, ' ', info.Model];
catch
coords(i).cam='';
end
if mod(i, 100)==0
disp(i)
end
if isempty(coords(i).filename)
pause
end
i =i+1; % if loop was successful.
else fprintf('%d: No GPS info\n', n)
end
else
fprintf('%d: File error\n', n)
end
end
disp('Finished loop.')
ctable=struct2table(coords);
writetable(ctable, tablePath);
% write shp
filesStruct=rmfield(coords, {'lat','long'});
p= mappoint([coords.long], [coords.lat], filesStruct);
shapewrite(p, shapePath);
%% view
% geoshow(shapePath)
没有合适的资源?快使用搜索试试~ 我知道了~
用于处理无人机数据分类、NDWI 水指数、提取和绘制 GPS 坐标附matlab代码.zip
共5个文件
m:5个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
1星 1 下载量 167 浏览量
2023-10-16
21:48:13
上传
评论 1
收藏 8KB ZIP 举报
温馨提示
1.版本:matlab2014/2019a/2021a,内含运行结果,不会运行可私信 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 5.作者介绍:某大厂资深算法工程师,从事Matlab算法仿真工作10年;擅长智能优化算法、神经网络预测、信号处理、元胞自动机等多种领域的算法仿真实验,更多仿真源码、数据集定制私信+。
资源推荐
资源详情
资源评论
收起资源包目录
用于处理无人机数据分类、NDWI 水指数、提取和绘制 GPS 坐标附matlab代码.zip (5个子文件)
用于处理无人机数据分类、NDWI 水指数、提取和绘制 GPS 坐标附matlab代码
other
viewNDWI.m 706B
plotPhotoCoords
plotPhotoCoordsPAD.m 2KB
plotPhotoCoords_camera.m 3KB
plotPhotoCoords.m 973B
classification
threshold.m 1KB
共 5 条
- 1
资源评论
- AllenAmanda2024-03-19测试数据没有,私信也不回。钱白花了,根本用不起来。 #标题与内容不符 #运行出错
Matlab科研辅导帮
- 粉丝: 1w+
- 资源: 7553
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功