我正在嘗試使用此功能,但遇到了一些錯誤。我將使用此功能從 FastICA 實現(xiàn)實時檢測來自 Android 相機(jī)的 RGB 圖像的峰值。我正在使用Double[] Green = ArrayUtils.toObject(arrayGreen);FastICA 的第一個參數(shù)輸出工作正常。我正在使用double delta=10;第二個參數(shù)并且很好。我在使用第三個參數(shù)時遇到問題,因為我不明白哪個是我需要的第三個參數(shù)。我試圖創(chuàng)建一個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 */編輯 使用第二個函數(shù)到第一個我遇到這個錯誤:
1 回答

慕萊塢森
TA貢獻(xiàn)1810條經(jīng)驗 獲得超4個贊
第三個參數(shù)有點奇怪——它是對應(yīng)最小值和最大值的名稱列表。因此,假設(shè)數(shù)據(jù)中的位置 1 處有 1,并且您將帶有列表的第三個參數(shù)(“A”、“B”、“C”)傳遞給它。返回值將是一個映射(“B”-> 最大值)。
它的代碼很奇怪,我不確定他們?yōu)槭裁催@樣做。這似乎是一種非常不方便的做事方式。另外,我認(rèn)為如果 index.size() < values.size() 他們的代碼會崩潰
請注意,它們的函數(shù)的 2 值版本正在傳入一個 (1,2,3,4,...n) 數(shù)組,其中 n 是數(shù)據(jù)中值的數(shù)量。在這種情況下,返回值將是(位置索引->最大值/最小值)的映射。這似乎是您應(yīng)該使用它的唯一方法。
添加回答
舉報
0/150
提交
取消