文件名称:testdtw(zhu)
-
所属分类:
- 标签属性:
- 上传时间:2012-09-04
-
文件大小:560byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
function dist = dtw(t,r)
n = size(t,1)
m = size(r,1)
帧匹配距离矩阵
d = zeros(n,m)
for i = 1:n
for j = 1:m
d(i,j) = sum((t(i,:)-r(j,:)).^2)
end
累积距离矩阵
D = ones(n,m) * realmax
D(1,1) = d(1,1)
动态规划
for i = 2:n
for j = 1:m
D1 = D(i-1,j)
if j>1
D2 = D(i-1,j-1)
else
D2 = realmax
end
if j>2
D3 = D(i-1,j-2)
else
D3 = realmax
end
D(i,j) = d(i,j) + min([D1,D2,D3])
end
end
dist = D(n,m) -function dist = dtw (t, r) n = size (t, 1) m = size (r, 1) frame matching distance matrix d = zeros (n, m) for i = 1: n for j = 1: md (i, j) = sum ((t (i,:)-r (j ,:)).^ 2) end end cumulative distance matrix D = ones (n, m)* realmax D ( 1,1) = d (1,1) dynamic programming for i = 2: n for j = 1: m D1 = D (i-1, j) if j> 1 D2 = D (i-1, j-1) else D2 = realmax end if j> 2 D3 = D (i-1, j-2) else D3 = realmax end D (i, j) = d (i, j)+ min ( [D1, D2, D3]) end end dist = D (n, m)
n = size(t,1)
m = size(r,1)
帧匹配距离矩阵
d = zeros(n,m)
for i = 1:n
for j = 1:m
d(i,j) = sum((t(i,:)-r(j,:)).^2)
end
累积距离矩阵
D = ones(n,m) * realmax
D(1,1) = d(1,1)
动态规划
for i = 2:n
for j = 1:m
D1 = D(i-1,j)
if j>1
D2 = D(i-1,j-1)
else
D2 = realmax
end
if j>2
D3 = D(i-1,j-2)
else
D3 = realmax
end
D(i,j) = d(i,j) + min([D1,D2,D3])
end
end
dist = D(n,m) -function dist = dtw (t, r) n = size (t, 1) m = size (r, 1) frame matching distance matrix d = zeros (n, m) for i = 1: n for j = 1: md (i, j) = sum ((t (i,:)-r (j ,:)).^ 2) end end cumulative distance matrix D = ones (n, m)* realmax D ( 1,1) = d (1,1) dynamic programming for i = 2: n for j = 1: m D1 = D (i-1, j) if j> 1 D2 = D (i-1, j-1) else D2 = realmax end if j> 2 D3 = D (i-1, j-2) else D3 = realmax end D (i, j) = d (i, j)+ min ( [D1, D2, D3]) end end dist = D (n, m)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
testdtw(zhu).m
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.