Apollo 11.0
自动驾驶开放平台
probabilities.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16#pragma once
17
18#include <algorithm>
19#include <vector>
20
21namespace apollo {
22namespace perception {
23namespace fusion {
24
25// @brief: bound given value within input range
26// @return bounded value within input range
27// @NOTE: original method name is bound
28template <typename T>
29T Bound(const T& value, const T& max_value, const T& min_value) {
30 return std::max(min_value, std::min(max_value, value));
31}
32
33// @brief: scale input prob within input range
34// @return bounded & scaled prob
35// @NOTE: original method name is bound_scale_probability
36double BoundedScalePositiveProbability(double p, double max_p, double min_p);
37
38// @brief: scale input prob
39// @return sclaed prob
40// @NOTE: original method name is scale_positive_probability
41double ScalePositiveProbability(double p, double max_p, double th_p);
42
43// @brief: calculate the Welsh Loss
44// @return Welsh Loss of input dist
45// @NOTE: original method name is Welsh_var_loss_fun
46double WelshVarLossFun(double dist, double th, double scale);
47
48// @brief: fuse two probabilities, fused prob is greater than 0.5, if
49// the sum of input prob pair is greater than 1, otherwise, fused prob
50// is less than 0.5.
51// @return fused prob of input prob pair
52// @NOTE: original method name is fused_tow_probabilities
53double FuseTwoProbabilities(double prob1, double prob2);
54
55// @brief: fuse multiple probabilities
56// @return fused probability of input multiple probabilities
57// @NOTE: original method name is fused_multiple_probabilities
58double FuseMultipleProbabilities(const std::vector<double>& probs);
59
60} // namespace fusion
61} // namespace perception
62} // namespace apollo
T Bound(const T &value, const T &max_value, const T &min_value)
double BoundedScalePositiveProbability(double p, double max_p, double min_p)
double FuseMultipleProbabilities(const std::vector< double > &probs)
double ScalePositiveProbability(double p, double max_p, double th_p)
double WelshVarLossFun(double dist, double th, double scale)
double FuseTwoProbabilities(double prob1, double prob2)
class register implement
Definition arena_queue.h:37