在MATLAB中查找2个图像集之间的最接近值

时间:2015-05-12 11:59:28

标签: matlab

我有2个图像集(每个包含100个图像):

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

因此,两个图像集之间存在转换。我尝试通过在第二组(第一秒)中生成重复来匹配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个图像集之间的最接近值?谢谢。

1 个答案:

答案 0 :(得分: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