读取siftgeo格式文件的matlab程序
来源:互联网 发布:网络虚拟交易平台 编辑:程序博客网 时间:2024/06/05 14:10
% This function reads a siftgeo binary file %读取siftgeo格式的二进制文件%% Usage: [v, meta] = siftgeo_read (filename, maxdes)% filename the input filename% maxdes maximum number of descriptors to be loaded 要加载的描述子最大数量% (default=unlimited)%默认无限制%% Returned values %返回值% v the sift descriptors (1 descriptor per line) %每行一个sift描述子% meta meta data for each descriptor, i.e., per line: %每个描述子的元数据% x, y, scale, angle, mi11, mi12, mi21, mi22, cornernessfunction [v, meta] = siftgeo_read (filename, maxdes) if nargin < 2 %nargin:number of arguments input %nargout:number of arguments ouput maxdes = 100000000; %1亿end % open the file and count the number of descriptorsfid = fopen (filename, 'r'); fseek (fid, 0, 1); %fseek(fid, 0, 'eof'); 跳到文件末尾 %'bof' or -1 Beginning of file; 'cof' or 0 Current position in file; 'eof' or 1 End of filen = ftell (fid) / (9 * 4 + 1 * 4 + 128); %n是descriptors的数量 %return the current position (number of bytes from the file beginning)fseek (fid, 0, -1); %fseek(fid, 0, 'bof') 跳到文件开头if n > maxdes n = maxdes;end;% first read the meta information associated with the descriptormeta = zeros (n, 9, 'single'); %n*9矩阵v = zeros (n, 128, 'single'); %n*128矩阵% read the elementsfor i = 1:n %n是要读区的descriptors数量 meta(i,:) = fread (fid, 9, 'float'); %(float)*9 元数据信息 d = fread (fid, 1, 'int'); %(int)*1 v(i,:) = fread (fid, d, 'uint8=>single'); %(uint8=>single)*d 描述子endfclose (fid);原文参考:http://blog.csdn.net/garfielder007/article/details/43370847
0 0
- 读取siftgeo格式文件的matlab程序
- 读取siftgeo格式文件的matlab程序
- matlab ASCII格式文件的读取。
- MATLAB读取不同行列的txt格式文件
- MATLAB 读取DICOM格式文件
- matlab读取img格式文件
- matlab读取arff格式文件前的环境配置工作
- matlab中csv格式文件的读取方法及效率
- PSD格式文件的读取
- PSD格式文件的读取
- PSD格式文件的读取
- PSD格式文件的读取
- PE格式文件的读取
- PSD格式文件的读取
- MT4 hst格式文件的读取
- 简单的读取xml格式文件
- 使用VS2010调用matlab的mat格式文件
- 使用VS2010调用matlab的mat格式文件
- 【自我修养】理解回调函数
- WDK error U1087: cannot have : and:: dependents for same target
- windows驱动编译,禁止指定的警告
- oracle 字段相关操作sql
- 境由心来......
- 读取siftgeo格式文件的matlab程序
- Microsoft Visual C++ 2010 可再发行组件包(x86) 运行时 msvcr
- windbg 符号表
- VirtualKD - Installation windbg加速
- WINDBG 下载指定DLL的PDB
- WINDBG,Deferred Symbol Loading
- jquery获取文件后缀的方法
- WinDBG 技巧:设断点命令详解(bp, bu, bm, ba 以及bl, bc, bd, be)
- 选择正规的短信服务商应注意的几点!