Skip to content

Commit

Permalink
SRT3D: compute mean probability for region modality
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Jun 6, 2023
1 parent 35c26c4 commit e6b0ba7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SRT3D/include/srt3d/region_modality.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ class RegionModality {
bool imshow_result() const;
bool set_up() const;

float probability_;

private:
// Helper methods for precalculation of internal data
void PrecalculateFunctionLookup();
Expand Down
5 changes: 5 additions & 0 deletions SRT3D/src/region_modality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ bool RegionModality::CalculatePoseUpdate(int corr_iteration,
gradient.setZero();
hessian.setZero();

probability_ = 0;
// Iterate over correspondence lines
for (auto &data_line : data_lines_) {
// Calculate point coordinates in camera frame
Expand Down Expand Up @@ -356,9 +357,13 @@ bool RegionModality::CalculatePoseUpdate(int corr_iteration,
ddelta_cs_dtheta /= data_line.standard_deviation;
hessian.triangularView<Eigen::Lower>() -=
ddelta_cs_dtheta.transpose() * ddelta_cs_dtheta;

probability_ += data_line.distribution[distribution_length_plus_1_half_];
}
hessian = hessian.selfadjointView<Eigen::Lower>();

probability_ /= data_lines_.size(); // mean probability

// Optimize and update pose
Eigen::FullPivLU<Eigen::Matrix<float, 6, 6>> lu{tikhonov_matrix_ - hessian};
if (lu.isInvertible()) {
Expand Down

0 comments on commit e6b0ba7

Please sign in to comment.