Skip to content

Commit e6b0ba7

Browse files
committed
SRT3D: compute mean probability for region modality
1 parent 35c26c4 commit e6b0ba7

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

SRT3D/include/srt3d/region_modality.h

+2
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ class RegionModality {
118118
bool imshow_result() const;
119119
bool set_up() const;
120120

121+
float probability_;
122+
121123
private:
122124
// Helper methods for precalculation of internal data
123125
void PrecalculateFunctionLookup();

SRT3D/src/region_modality.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ bool RegionModality::CalculatePoseUpdate(int corr_iteration,
301301
gradient.setZero();
302302
hessian.setZero();
303303

304+
probability_ = 0;
304305
// Iterate over correspondence lines
305306
for (auto &data_line : data_lines_) {
306307
// Calculate point coordinates in camera frame
@@ -356,9 +357,13 @@ bool RegionModality::CalculatePoseUpdate(int corr_iteration,
356357
ddelta_cs_dtheta /= data_line.standard_deviation;
357358
hessian.triangularView<Eigen::Lower>() -=
358359
ddelta_cs_dtheta.transpose() * ddelta_cs_dtheta;
360+
361+
probability_ += data_line.distribution[distribution_length_plus_1_half_];
359362
}
360363
hessian = hessian.selfadjointView<Eigen::Lower>();
361364

365+
probability_ /= data_lines_.size(); // mean probability
366+
362367
// Optimize and update pose
363368
Eigen::FullPivLU<Eigen::Matrix<float, 6, 6>> lu{tikhonov_matrix_ - hessian};
364369
if (lu.isInvertible()) {

0 commit comments

Comments
 (0)