⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sum_distance.m

📁 用Cross validation的方法建立人工神经网络的模型!
💻 M
字号:
%  function distance = Sum_distance(x_compressed, y_compressed, cdbk_distance): image
%  similarity calculation based on sumation of Euclidean distance over all 
%  pairs of codewords
% 
% Input:    x_compressed -- 1*N, a row stores all indices of keyblocks to
%                           represent the current image x
%           y_compressed -- 
%          cdbk_distance -- nwds*nwds matrix, cdbk_similarity(i,j)
%                           represents the distance between ith and jth
%                           codeword in codebook
% Output: 
%               distance -- float number, the similarity between image x
%                           and y
%

function distance = Sum_distance(x_compressed, y_compressed, cdbk_distance)

nwds = size(cdbk_distance, 1);
n_point = size(x_compressed, 2);

distance = 0;

for i = 1: n_point
    distance = distance + cdbk_distance(x_compressed(i), y_compressed(i));
end

distance = sqrt(distance);

⌨️ 快捷键说明

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