2015-05-12 22 views
0

2个图像组之间的最接近的值I 2个具有图像集(每片含100个图像):查找MATLAB

-> First set: a1, a2,..., a100 (15 images per second) 
-> Second set: b1, b2,..., b100 (6 images per second) 

所以,存在2个图像集之间的位移。我试图通过在所述第二组(对于第一第二)产生重复以匹配2台:

-> a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 
-> b1, b1, b2, b2, b3, b3, b4, b4, b5, b5, b6, b6 

但是随着图像数量的增加,在2组之间的移位增加进一步更。 有谁知道如何找到2个图像集之间的最接近的值为任何给定数量的图像?谢谢。

+1

为什么你复制帧?你怎么知道有多少次复制它?请让你的问题更清楚一点 – roni

+0

这是一个粗略的复制帧的近似,我这样做是因为我想要两组中最接近可能的帧数。但这并不准确,反向采样似乎不是一个好主意。 – Bowecho

回答

0

解决此问题的一种方法是从两个时间序列的时间框架(A和B)开始。接下来,找到B中最接近您所选框架的A元素(使用minabs)。同样的推理适用于从A中的元素搜索B.

rate1 = 15 %images per second 
rate2 = 6 %images per second 

%create timestamps for the two series 
A = cumsum(ones(1,100) * (1/rate1)); 
B = cumsum(ones(1,100) * (1/rate2)); 

%find which of the given element in B is the closest in A 
indB = 24 % an arbitrary element of B 
[M,I] = min(abs(A - B(indB))); % I is the index of the closest A element 
+0

这很有趣..感谢分享。如果在两个图像集中频率(每秒帧数)不是固定的,怎么办?在这个问题中, – Bowecho

+0

,没关系。 A和B可以有任何时间戳,但需要长度相同。一般来说,这不是一个完整的解决方案,只是提示如何看待问题。 – marsei