亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

我如何使用 peak_detection 功能 - Android studio

我如何使用 peak_detection 功能 - Android studio

森林海 2021-09-12 10:30:13
我正在嘗試使用此功能,但遇到了一些錯誤。我將使用此功能從 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 是數據中值的數量。在這種情況下,返回值將是(位置索引->最大值/最小值)的映射。這似乎是您應該使用它的唯一方法。


查看完整回答
反對 回復 2021-09-12
  • 1 回答
  • 0 關注
  • 111 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號