-
-
Notifications
You must be signed in to change notification settings - Fork 832
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1803 from alicevision/dev/sfmLidar
Use lidar as constraints in sfm
- Loading branch information
Showing
41 changed files
with
1,355 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/aliceVision/sfm/bundle/costfunctions/constraintPoint.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// This file is part of the AliceVision project. | ||
// Copyright (c) 2025 AliceVision contributors. | ||
// This Source Code Form is subject to the terms of the Mozilla Public License, | ||
// v. 2.0. If a copy of the MPL was not distributed with this file, | ||
// You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
#pragma once | ||
|
||
#include <aliceVision/camera/camera.hpp> | ||
|
||
namespace aliceVision { | ||
namespace sfm { | ||
|
||
struct ConstraintPointErrorFunctor | ||
{ | ||
explicit ConstraintPointErrorFunctor(const double weight, const Vec3 & normal, const Vec3 & point) | ||
: _weight(weight), _normal(normal) | ||
{ | ||
_constraintDistance = _normal.dot(point); | ||
} | ||
|
||
template<typename T> | ||
bool operator()(T const* const* parameters, T* residuals) const | ||
{ | ||
const T* parameter_point = parameters[0]; | ||
|
||
T distance = parameter_point[0] * _normal[0] + parameter_point[1] * _normal[1] + parameter_point[2] * _normal[2]; | ||
residuals[0] = _weight * (distance - _constraintDistance); | ||
|
||
return true; | ||
} | ||
|
||
double _weight; | ||
Vec3 _normal; | ||
double _constraintDistance; | ||
}; | ||
|
||
} // namespace sfm | ||
} // namespace aliceVision |
Oops, something went wrong.