Apollo 11.0
自动驾驶开放平台
ccrf_type_fusion.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2024 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
17#pragma once
18
19#include <functional>
20#include <map>
21#include <memory>
22#include <string>
23#include <vector>
24
30
31namespace apollo {
32namespace perception {
33namespace lidar {
34
36 public:
37 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
38
39 bool Init(const TypeFilterInitOption& option) override;
40
41 bool TypeFusion(const TypeFilterOption& option,
42 TrackedObjectPtr new_object) override;
43
44 std::string Name() const override {
45 return "CCRFSingleShotTypeFusion";
46 }
47
48 bool FuseOneShotTypeProbs(const TrackedObjectConstPtr& new_object,
49 Vectord* log_prob);
50
51 protected:
54 bool debug_log_ = false;
55};
56
58 public:
59 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
60
61 bool Init(const TypeFilterInitOption& option) override;
62
63 bool TypeFusion(
64 const TypeFilterOption& option,
65 const std::vector<TrackedObjectConstPtr>& tracked_objects,
66 TrackedObjectPtr new_object) override;
67
68 std::string Name() const override {
69 return "CCRFMultiShotTypeFusion";
70 }
71
72 protected:
73 // The fusion problem is modeled
74 // as inferring the discrete state in a chain CRFs.
75 // Note, log(P({X}|O)) =
76 // sigma_i{E_unary(X_i,O)} + sigma_ij{E_pairwise(X_i,X_j)} - logZ;
77 // E_unary(X_i,O) = sigma{logP(classifier)},
78 // E_pairwise(X_i,X_j) = logTransition(X_i,X_j)
79 // a) Maximize the sequence probability P(X_t|{X}^opt,O)
80 // based on optimal state inference.
81 // b) (did not use) Maximize the marginal probability P(X_t|O)
82 // with history state integrated.
83
84 // window version of Chain-CRFs inference
86 const std::vector<TrackedObjectConstPtr>& tracked_objects,
87 TrackedObjectPtr new_object);
88 // util
89 bool RecoverFromLogProbability(Vectord* prob, std::vector<float>* dst,
91
92 protected:
94 // Note all in the log space
96
97 // data member for window inference version
101
102 protected:
103 double s_alpha_ = 1.8;
104 bool debug_log_ = false;
105};
106
107} // namespace lidar
108} // namespace perception
109} // namespace apollo
bool TypeFusion(const TypeFilterOption &option, const std::vector< TrackedObjectConstPtr > &tracked_objects, TrackedObjectPtr new_object) override
apollo::common::EigenVector< Vectord > fused_sequence_probs_
bool RecoverFromLogProbability(Vectord *prob, std::vector< float > *dst, perception::base::ObjectType *type)
EIGEN_MAKE_ALIGNED_OPERATOR_NEW bool Init(const TypeFilterInitOption &option) override
bool FuseWithConditionalProbabilityInference(const std::vector< TrackedObjectConstPtr > &tracked_objects, TrackedObjectPtr new_object)
apollo::common::EigenVector< Vectori > state_back_trace_
apollo::common::EigenVector< Vectord > fused_oneshot_probs_
bool TypeFusion(const TypeFilterOption &option, TrackedObjectPtr new_object) override
bool FuseOneShotTypeProbs(const TrackedObjectConstPtr &new_object, Vectord *log_prob)
EIGEN_MAKE_ALIGNED_OPERATOR_NEW bool Init(const TypeFilterInitOption &option) override
apollo::common::EigenMap< std::string, Matrixd > smooth_matrices_
std::map< T, EigenType, std::less< T >, Eigen::aligned_allocator< std::pair< const T, EigenType > > > EigenMap
Definition eigen_defs.h:40
std::vector< EigenType, Eigen::aligned_allocator< EigenType > > EigenVector
Definition eigen_defs.h:33
std::shared_ptr< const TrackedObject > TrackedObjectConstPtr
Eigen::Matrix< double, VALID_OBJECT_TYPE, VALID_OBJECT_TYPE > Matrixd
Definition util.h:40
Eigen::Matrix< double, VALID_OBJECT_TYPE, 1 > Vectord
Definition util.h:38
std::shared_ptr< TrackedObject > TrackedObjectPtr
class register implement
Definition arena_queue.h:37