我正在尝试使用此功能,但遇到了一些错误。我将使用此功能从 FastICA 实现实时检测来自 Android 相机的 RGB 图像的峰值。我正在使用Double[] Green = ArrayUtils.toObject(arrayGreen);FastICA 的第一个参数输出工作正常。我正在使用double delta=10;第二个参数并且很好。我在使用第三个参数时遇到问题,因为我不明白哪个是我需要的第三个参数。我试图创建一个List<Integer> indices = new ArrayList<Integer>();但没有工作。有人可以帮我吗?提前致谢我正在尝试的代码:import java.util.ArrayList;import java.util.List;import java.util.HashMap;import java.util.Map;public abstract class CustomUtils { /** * Detects peaks (calculates local minima and maxima) in the * vector <code>values</code>. The resulting list contains * maxima at the first position and minima at the last one. * * Maxima and minima maps contain the indice value for a * given position and the value from a corresponding vector. * * A point is considered a maximum peak if it has the maximal * value, and was preceded (to the left) by a value lower by * <code>delta</code>. * * @param values Vector of values for whom the peaks should be detected * @param delta The precedor of a maximum peak * @param indices Vector of indices that replace positions in resulting maps * @return List of maps (maxima and minima pairs) of detected peaks */编辑 使用第二个函数到第一个我遇到这个错误:
1 回答
慕莱坞森
TA贡献1810条经验 获得超4个赞
第三个参数有点奇怪——它是对应最小值和最大值的名称列表。因此,假设数据中的位置 1 处有 1,并且您将带有列表的第三个参数(“A”、“B”、“C”)传递给它。返回值将是一个映射(“B”-> 最大值)。
它的代码很奇怪,我不确定他们为什么这样做。这似乎是一种非常不方便的做事方式。另外,我认为如果 index.size() < values.size() 他们的代码会崩溃
请注意,它们的函数的 2 值版本正在传入一个 (1,2,3,4,...n) 数组,其中 n 是数据中值的数量。在这种情况下,返回值将是(位置索引->最大值/最小值)的映射。这似乎是您应该使用它的唯一方法。
添加回答
举报
0/150
提交
取消