• 大小: 87KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-14
  • 语言: 其他
  • 标签: matlab  fd  图像匹配  

资源简介

实现读取C数据的功能,输入索引的序号,将图像按照与索引图像的相似程度进行排序

资源截图

代码片段和文件信息

%%%傅里叶特征描述子功能函数
function sfz =fd_function(f)
%[filename pathname] = uigetfile({‘*.c‘ ‘All c-Files (*.c)‘; ‘*.dat‘ ‘All tif-Files (*.dat)‘;‘*.*‘‘All Files (*.*)‘}‘Select a curve‘); 
% If “Cancel“  then return
%if isequal([filenamepathname][00]) 
% return 
% end  
% File = fullfile(pathnamefilename); 
% f=strcat(pathnamefilename); 
    fid = fopen(f‘rt‘);              % fid为输入文件标识 
    tline = fgetl(fid); 
    datalen=str2num(tline(3:length(tline)));  % 去tline中从第三个字符到最后一个字符并转换为数字,datalen即为点数 
    DataRange=zeros(datalen2); 
    i=0; 
    while 1 
        i=i+1; 
        tline = fgetl(fid); 
        if ~ischar(tline) 
            break 
        end       % 输入tline不为字符,跳出 
        divpos=0; 
        while 1 
            divpos=divpos+1; 
            if tline(divpos)==‘ ‘ 
                break 
            end 
        end 
        DataRange(i1)=str2num(tline(1:divpos)); 
        DataRange(i2)=str2num(tline(divpos:length(tline)));      % datarange第一行为x坐标,第二行为y坐标 
    end 
    fclose(fid);   
   N=i-1;        % Number of points in the curve 
   for n=1:N 
       z(n)=DataRange(n1)+DataRange(n2)*j;  % form a complex function z 
   end 
   fz=fft(z);                                 % Fourier thransform of z 
   sfz=zeros(116);                            % pickup savaral coeficeants of low frequency可调整 
   for n=1:8 
      sfz(n)=fz(n); 
   end 
   for n=N-7:N 
      sfz(n-N+8)=fz(n); 
   end 
    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1543  2014-06-03 19:43  fourier descriptor\fd_function.m

     文件       1303  2014-06-03 20:11  fourier descriptor\fourierdescriptor.asv

     文件       1305  2014-06-03 20:11  fourier descriptor\fourierdescriptor.m

     文件       6697  2014-06-03 19:34  fourier descriptor\kk1063.c

     文件      17224  2014-06-03 20:09  fourier descriptor\kk1063.jpg

     文件       7090  2014-06-03 19:38  fourier descriptor\kk353.c

     文件      18973  2014-06-03 20:09  fourier descriptor\kk353.jpg

     文件       7106  2014-06-03 19:37  fourier descriptor\kk354.c

     文件      18052  2014-06-03 20:09  fourier descriptor\kk354.jpg

     文件       7163  2014-06-03 19:36  fourier descriptor\kk395.c

     文件      17892  2014-06-03 20:09  fourier descriptor\kk395.jpg

     文件       6091  2014-06-03 19:36  fourier descriptor\kk396.c

     文件      17422  2014-06-03 20:09  fourier descriptor\kk396.jpg

     文件       9156  2014-06-03 19:35  fourier descriptor\kk99.c

     文件      18716  2014-06-03 20:08  fourier descriptor\kk99.jpg

     文件       2426  2014-06-03 20:01  fourier descriptor\Untitled3.asv

     文件       2444  2014-06-03 20:02  fourier descriptor\Untitled3.m

     目录          0  2014-06-03 20:15  fourier descriptor

----------- ---------  ---------- -----  ----

               160603                    18


评论

共有 条评论