繁体   English   中英

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

[英]Find closest values between 2 image sets in 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

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

解决此问题的一种方法是从两个时间序列的时间范围(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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM