Skip to content

Commit

Permalink
[Trifocal+P2Pt] all tests pass, templating two_view kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
rfabbri committed Nov 12, 2024
1 parent a316e03 commit 3429138
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ using l1PoseResectionKernel =
two_view::kernel::Kernel<
l1SixPointResectionSolver,
l1SixPointResectionSolver,
Mat34>;
Mat34, 2>;

} // namespace kernel
} // namespace lInfinityCV
Expand Down
2 changes: 1 addition & 1 deletion src/openMVG/multiview/solver_resection_kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ using PoseResectionKernel =
two_view::kernel::Kernel<
SixPointResectionSolver, // Model estimator
resection::PixelReprojectionError, // Error metric
Mat34>;
Mat34, 2>;

} // namespace kernel
} // namespace resection
Expand Down
3 changes: 0 additions & 3 deletions src/openMVG/multiview/solver_resection_kernel_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
using namespace openMVG;
using namespace openMVG::cameras;

#if 0

TEST(Resection_Kernel_DLT, Multiview) {

const int nViews = 3;
Expand Down Expand Up @@ -259,7 +257,6 @@ TEST(UP2PSolver_Kukelova, Multiview) {
}
}
}
#endif

TEST(P2Pt_Fabbri_ECCV12, Multiview)
{
Expand Down
6 changes: 4 additions & 2 deletions src/openMVG/multiview/two_view_kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ namespace kernel {
// should append new solutions to the end.
template<typename SolverArg,
typename ErrorArg,
typename ModelArg = Mat3>
typename ModelArg = Mat3,
int ImagePointDim = 3
>
class Kernel {
public:
Kernel(const Mat &x1, const Mat &x2) : x1_(x1), x2_(x2) {}
Expand All @@ -87,7 +89,7 @@ class Kernel {
}
/// Return the error associated to the model and sample^nth point
double Error(uint32_t sample, const Model &model) const {
return ErrorArg::Error(model, x1_.col(sample).head(3), x2_.col(sample).head(3));
return ErrorArg::Error(model, x1_.col(sample).head(ImagePointDim), x2_.col(sample).head(3));
}
/// Number of putative point
size_t NumSamples() const {
Expand Down

0 comments on commit 3429138

Please sign in to comment.