cbir_featurecalc.m

来自「matlab编程」· M 代码 · 共 29 行

M
29
字号
function CBIR_featurecalc()
% EE6850 HW3, Content-Based Image Retrieval
% CBIR_featurecalc() --- feature calculation 
% input:
% output:
%   Feature vectors of each image
%       saved as a struct in .mat file: imgname.feature_name
%       current supported features: 
% 10-19-2001, xlx@ee.columbia.edu

% some global constants
DEBUG = 0;
imgdir = 'H:\courses\vis\hw3\images\';
fetdir = 'H:\courses\vis\hw3\features\';
imgno = 243:245;
imgsuffix = '.png';

% read each image, calculate the feature struct
for i=imgno
    imgrgb=imread([imgdir,num2str(i),imgsuffix]);
    if DEBUG
        imshow(imgrgb);
    end
    
    feature.colorhist = CBIR_colorhist(imgrgb);
    feature.edgehist = CBIR_edgehist(imgrgb);
    feature.edgedirection = CBIR_edgedirection(imgrgb);
    save([fetdir,num2str(i),'.mat'], 'feature');
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?