Skip to content

Commit

Permalink
correct initialization in distortion convertion
Browse files Browse the repository at this point in the history
  • Loading branch information
servantftechnicolor committed Sep 26, 2024
1 parent eab0f49 commit 66e760b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/aliceVision/camera/DistortionRadial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace radial_distortion {
* @return optimal radius
*/
template<class Disto_Functor>
double bisection_Radius_Solve(const std::vector<double>& params, double r2, Disto_Functor& functor, double epsilon = 1e-8)
double bisection_Radius_Solve(const std::vector<double>& params, double r2, Disto_Functor& functor, double epsilon = 1e-16)
{
// Guess plausible upper and lower bound
double lowerbound = r2, upbound = r2;
Expand Down
5 changes: 3 additions & 2 deletions src/aliceVision/camera/Undistortion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ class Undistortion
public:
Undistortion(int width, int height)
{
setSize(width, height);
setOffset({0.0, 0.0});
_pixelAspectRatio = 1.0;
_isDesqueezed = false;

setSize(width, height);
setOffset({0.0, 0.0});
}

virtual EUNDISTORTION getType() const = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/software/convert/main_convertDistortion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ bool convert(std::shared_ptr<camera::Undistortion> & undistortion, const camera:
calibration::PointPair ppt;
ppt.distortedPoint = pobs.second.getCoordinates();
ppt.undistortedPoint = intrinsic.getUndistortedPixel(ppt.distortedPoint);
ppt.scale = pobs.second.getScale();

Vec2 check = intrinsic.getDistortedPixel(ppt.undistortedPoint);
if ((check - ppt.distortedPoint).norm() > 1e-2)
if ((check - ppt.distortedPoint).norm() > 1e-3)
{
countErrors++;
continue;
Expand Down

0 comments on commit 66e760b

Please sign in to comment.