Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New hdri stitching software #678

Merged
merged 182 commits into from
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
8f4a0b0
[software] New software for stithing fisheye images in 360° panorama
ToukL Jul 25, 2019
737ed20
[cmake] add ILMBASE_INCLUDE_PATH to FindOpenImageIO
ToukL Jul 25, 2019
d21c101
[image] add instantiation for float RGBA pixel type
ToukL Jul 25, 2019
5077007
[image] add RGBA default constructor with all channels set to zero
ToukL Jul 25, 2019
bdd2b91
[image][Sampler] bug fix : call to default constructor
ToukL Jul 25, 2019
c7e842c
[software] add doxygen doc
ToukL Jul 26, 2019
4f733fa
[software] modify default rotation angles
ToukL Jul 26, 2019
b4c5454
[software] add option to give complete output path insted of folder
ToukL Jul 26, 2019
110be8d
Merge branch 'develop' into dev_hdri_stitching
ToukL Aug 7, 2019
6a02f93
[software] stitching: move buffer initialization
ToukL Aug 7, 2019
e577670
[software] stitching: bug fix on buffer copy
ToukL Aug 7, 2019
0d76793
[software] stitching: change log info description
ToukL Aug 7, 2019
4e49836
[imageIO] add isSuported function to check input image extension
ToukL Aug 8, 2019
0c69255
[software] stitchin: add log error message
ToukL Aug 8, 2019
363a664
[software] stitching: get only valid image files from input folder
ToukL Aug 8, 2019
670b54d
[software] stitching: add parameter to adjust blur width in alpha mask
ToukL Aug 8, 2019
9cf0d1d
[image] pixelTypes: replace all typedef by using
ToukL Aug 9, 2019
25cffd4
[imageIO] add const
ToukL Aug 9, 2019
b2aec22
[software] Stitching: add or remove const and clean code
ToukL Aug 9, 2019
78b8041
[software] Stitching: change class SphericalMaping to namespace
ToukL Aug 9, 2019
0e03fc1
[software] Stitching: add function to sort images by time
ToukL Aug 9, 2019
8edd995
[globalSfM] Add enum methods for rotations and translations
ToukL Aug 12, 2019
6de58b6
[sfm] Add panorama reconstruction engine based on global sfm
ToukL Aug 19, 2019
237b542
[software] New software for stitching panorama with feature matching
ToukL Aug 19, 2019
bb929c1
[globalSfM] Add max_angular_error for triplet rotation rejection
ToukL Aug 19, 2019
be120eb
[sfm] Add log infos
ToukL Aug 19, 2019
9cdfb96
[panorama] remove aliceVision namespace
ToukL Aug 26, 2019
e2fcd33
[panorama] move maxIterations as default parameter
ToukL Aug 28, 2019
d9df8fa
[panorama] move structure RelativeRotation from .cpp to .hpp
ToukL Aug 28, 2019
c18c79a
[sfm] include ReconstructionEngine_panorama.hpp
ToukL Aug 28, 2019
3a50728
[panorama] Add unit test for panorama SfM
ToukL Aug 28, 2019
e474a82
[software] panoramaEstimation: rename panorama into panoramaEstimatio…
fabiencastan Sep 18, 2019
191c1ac
[software] add WIP panoramaStitching
fabiencastan Sep 18, 2019
99f871b
[sfm] utils: minor change in alignment and add log
fabiencastan Sep 18, 2019
a231d7a
[camera] add backproject utility function
fabiencastan Sep 18, 2019
cbb4ed9
[sfm] alignment: fix orientation read from metadata
fabiencastan Sep 18, 2019
258e104
[software] panoramaStitching: use image metadata orientation in the h…
fabiencastan Sep 18, 2019
39a7783
[software] panoramaStitching: fix masking and contributions
fabiencastan Sep 18, 2019
b604455
[software] panoramaStitching: ad debugging param to compute only a su…
fabiencastan Sep 18, 2019
a9d51d1
[software] panoramaEstimation: remove colorize and change some log
fabiencastan Sep 18, 2019
4562124
[software] panoramaEstimation: change debug param code values
fabiencastan Sep 18, 2019
5f7f08e
[software] panoramaStitching: change debug option to stitch only a su…
fabiencastan Sep 18, 2019
55b73a8
[software] panoramaEstimation: add WIP option to refine
fabiencastan Sep 18, 2019
5bcf34d
modify pretty print such that it is not used for Eigen types.
servantftechnicolor Sep 24, 2019
a35fc75
Function transforming equirectangular coordinates to spherical coordi…
servantftechnicolor Sep 24, 2019
6fea9d1
Doing a cout on a static array doesn't work on my compiler. I just di…
servantftechnicolor Sep 24, 2019
87b63a7
DLT input coordinates have to be normalized before use.
servantftechnicolor Sep 24, 2019
4a6c18e
Remove concept of landmarks from panorama estimation
servantftechnicolor Sep 24, 2019
956fd99
Add the constraint2D concept. Describe explicitely a match between 2 …
servantftechnicolor Sep 24, 2019
9a87635
add some override keywords to remove warnings
servantftechnicolor Sep 25, 2019
030f79f
create some skeleton for ceres cost function for 2D constraints
servantftechnicolor Sep 25, 2019
7673f28
Adding panorama 2D constraints for bundle adjustment
servantftechnicolor Sep 25, 2019
fdeb437
remove useless code
servantftechnicolor Sep 25, 2019
382ce56
add panorama size estimation algorithm
servantftechnicolor Sep 25, 2019
7f5df6c
Adding distortion estimation in radial1
servantftechnicolor Sep 26, 2019
804a4af
adding check on reprojection
servantftechnicolor Sep 26, 2019
664e2c7
Add fisheye cost function for constraint ...
servantftechnicolor Sep 26, 2019
fce1909
Adding a skeleton for equidistant camera
servantftechnicolor Sep 27, 2019
f927ee3
Reader for ninja xml file
servantftechnicolor Sep 30, 2019
db13568
prior on rotation
servantftechnicolor Oct 1, 2019
8517dd4
amman working
servantftechnicolor Oct 1, 2019
e999483
corrections for xml read
servantftechnicolor Oct 2, 2019
1ed1753
Sign error in spherical mapping from equirectangular
servantftechnicolor Oct 3, 2019
a1c832e
Currently applying laplacian blending (WIP)
servantftechnicolor Oct 4, 2019
2d7c36c
Trying to make hdr work on stitching
servantftechnicolor Oct 7, 2019
cdab531
At least remove unused images ...
servantftechnicolor Oct 7, 2019
e223770
make sure output can be sorted alphabetically correctly
servantftechnicolor Oct 7, 2019
9099d78
backup
servantftechnicolor Oct 7, 2019
4bacac0
laplacian results
servantftechnicolor Oct 8, 2019
b8c299c
Still working on laplacian blending (wip)
servantftechnicolor Oct 9, 2019
6179a43
rescratch laplacian
servantftechnicolor Oct 11, 2019
84e86c0
Restart stitching for cleaner code
servantftechnicolor Oct 14, 2019
a74a294
laplacian
servantftechnicolor Oct 14, 2019
11c2c1f
some laplacian changes
servantftechnicolor Oct 15, 2019
fc86b28
fuly working laplacian
servantftechnicolor Oct 15, 2019
7745ae3
multi level warping
servantftechnicolor Oct 16, 2019
a5f3d0e
adding alphacompositer
servantftechnicolor Oct 17, 2019
640731f
wip borders
servantftechnicolor Oct 18, 2019
e5173ff
panorama
servantftechnicolor Oct 21, 2019
0629071
temporary hack for hdr rotation problem
servantftechnicolor Oct 21, 2019
1b3150e
Heuristics to lower memory usage for coordinates evaluation
servantftechnicolor Oct 22, 2019
75c1e9d
add heuristics for camera with fov>180
servantftechnicolor Oct 23, 2019
f6cf207
add new heuristics for large fov
servantftechnicolor Oct 23, 2019
a0020f7
Border bug
servantftechnicolor Oct 23, 2019
85112a4
Eigen modifications
servantftechnicolor Oct 23, 2019
457e72e
Bug in borders
servantftechnicolor Oct 23, 2019
98f1d1f
Parameter for panorama size
servantftechnicolor Oct 24, 2019
17b5d86
remove recover source image... it is not useful in the current pipeline
servantftechnicolor Oct 24, 2019
ecb6804
Rescratch LDR to HDR main to integrate into pipeline
servantftechnicolor Oct 25, 2019
fd99ee2
less memory usage
servantftechnicolor Oct 25, 2019
633f046
update to hdr
servantftechnicolor Oct 25, 2019
e68fa67
Revert "update to hdr"
servantftechnicolor Oct 25, 2019
1870454
Correct an error with the output sfm
servantftechnicolor Oct 25, 2019
95bb845
Some bug in stitching
servantftechnicolor Oct 25, 2019
802571c
remove commented code
servantftechnicolor Oct 25, 2019
a028475
Replace laplacian
servantftechnicolor Oct 25, 2019
fd795d1
Handle rotated images for unknown reason
servantftechnicolor Oct 25, 2019
5d748a1
forgot to update image size after rotation
servantftechnicolor Oct 25, 2019
3547e83
[software] stitching: minor change for openimageio 1.8.12
fabiencastan Nov 1, 2019
0f6ee90
[software] stitching: windows build compatibility (disable openmp on …
fabiencastan Nov 1, 2019
b2444a4
remove colorspace error when rotating
servantftechnicolor Nov 4, 2019
197a341
add rotation prior on sfmdata
servantftechnicolor Nov 6, 2019
861c1af
rotation constraints
servantftechnicolor Nov 7, 2019
8dbc7af
Ignore pose lock
servantftechnicolor Nov 7, 2019
d3a8181
A new node for camera downscale for faster stitching debug
servantftechnicolor Nov 7, 2019
0510a1d
rescale node
servantftechnicolor Nov 7, 2019
7ed0e60
Bounding box algorithm to be replaced
servantftechnicolor Nov 8, 2019
783d4ab
bugs with hdr
servantftechnicolor Nov 8, 2019
76598cf
add new constraints for bounding box
servantftechnicolor Nov 8, 2019
3c77d5d
[hdr] formatting changes
fabiencastan Nov 12, 2019
684d073
[hdr] add option to export RGB response function as html chart
fabiencastan Nov 12, 2019
c2b66f4
[hdr] clean hdr fusion
fabiencastan Nov 12, 2019
cb97617
[hdr] grossberg: use images paths in input (instead of all images)
fabiencastan Nov 12, 2019
020c427
[software] LDRToHDR: re-expose important options
fabiencastan Nov 12, 2019
3da66b7
Merge branch 'dev_hdri_stitching' of https://github.com/alicevision/A…
fabiencastan Nov 12, 2019
a53b414
Merge branch 'dev_hdri_stitching' of github.com:alicevision/AliceVisi…
servantftechnicolor Nov 12, 2019
b4f7dd1
splitting compositing with warping
servantftechnicolor Nov 13, 2019
426bf32
merge
servantftechnicolor Nov 14, 2019
8788e53
updates to pipeline on compositing
servantftechnicolor Nov 14, 2019
f3d5f8d
laplacian pyramid
servantftechnicolor Nov 15, 2019
0f3f161
currently working on laplacian pyramid
servantftechnicolor Nov 18, 2019
87777fc
WIP laplacian
servantftechnicolor Nov 19, 2019
6a729e6
[hdr] fix image size of the output hdr fusion
fabiencastan Nov 20, 2019
9c1cb2e
add radial4 for stitching
servantftechnicolor Nov 20, 2019
b65cc30
correct laplacian
servantftechnicolor Nov 20, 2019
f776121
Merge branch 'dev_hdri_stitching' of github.com:alicevision/AliceVisi…
servantftechnicolor Nov 21, 2019
168d6f3
some tests
servantftechnicolor Nov 22, 2019
c2696ea
add option for multiband
servantftechnicolor Nov 25, 2019
fdce092
trials without gaussians
servantftechnicolor Nov 26, 2019
6faa7b2
[hdr] wip changing highlight correction
fabiencastan Nov 26, 2019
bbcd5e0
[hdr] use general camera exposure instead of shutter speed
fabiencastan Nov 28, 2019
21a4f03
[software] LDRToHDR formatting
fabiencastan Nov 28, 2019
9ee8b30
[hdr] highlight correction is now a post-processing step
fabiencastan Nov 29, 2019
368ab28
[hdr] formatting
fabiencastan Nov 29, 2019
4e7ca46
[software] ldr2hdr: minor fix on calibrationNbPoints==0
fabiencastan Dec 2, 2019
d0f4d65
[hdr] fix identation
fabiencastan Dec 2, 2019
8303d14
sync with paris
servantftechnicolor Dec 3, 2019
4dddb5f
sync
servantftechnicolor Dec 3, 2019
cc37725
[hdr] fix triangular function
fabiencastan Dec 5, 2019
a5378aa
[hdr] specific case for longest exposure hdr merge
fabiencastan Dec 5, 2019
1d54f90
[hdr] export weight functions
fabiencastan Dec 5, 2019
3f99913
[hdr] replace plateau with plateauSigmoid
fabiencastan Dec 5, 2019
1f298ce
[hdr] rgbCurve: add gamma functions
fabiencastan Dec 5, 2019
42debb5
wip laplacian
servantftechnicolor Dec 6, 2019
c56cc20
[hdr] add new HDR calibration method named "Laguerre"
fabiencastan Dec 6, 2019
4af5ffc
[hdr] Laguerre: supports multiple images with the same exposure
fabiencastan Dec 9, 2019
a8d5d51
[hdr] move sampling in a dedicated file
fabiencastan Dec 9, 2019
a2330eb
[hdr] rename BundleAdjustmentCalibration into LaguerreBACalibration
fabiencastan Dec 9, 2019
00f8ae0
Bug on image border for sampler
servantftechnicolor Dec 9, 2019
a601611
WIP memory reduction
servantftechnicolor Dec 9, 2019
b86b7f5
[hdr] laguerre: update input exposures if refined
fabiencastan Dec 9, 2019
6bf245a
[hdr] laguerre: lock exposures if not refined
fabiencastan Dec 9, 2019
39744c1
[hdr] add weighting function in Laguerre and add image downscale in c…
fabiencastan Dec 9, 2019
ee19530
bug in pixel additions
servantftechnicolor Dec 10, 2019
7754b81
memory footprint reduction
servantftechnicolor Dec 10, 2019
0a6d674
memory reduction
servantftechnicolor Dec 10, 2019
5096d47
Merge branch 'dev_hdri_stitching' of https://github.com/alicevision/A…
fabiencastan Dec 10, 2019
d967fb8
add offsets to rotation for panorama
servantftechnicolor Dec 11, 2019
900def1
add bypass to HDR
servantftechnicolor Dec 11, 2019
e5c8877
some correction on alpha blending
servantftechnicolor Dec 11, 2019
c23879a
[hdr] laguerre: remove weighting
fabiencastan Dec 11, 2019
0002d13
[build] Eigen compatibility: use Matrix instead of Vector
fabiencastan Dec 11, 2019
339fcb5
Merge branch 'dev_hdri_stitching' of github.com:alicevision/AliceVisi…
servantftechnicolor Dec 12, 2019
cbb3e86
[software] LdrToHdr: rename parameters for highlight postprocessing
fabiencastan Dec 12, 2019
38e469a
[software] LdrToHdr: remove export of debug files
fabiencastan Dec 12, 2019
2aff5ae
[software] panoramaWarping: export images in AUTO (no impact as the o…
fabiencastan Dec 12, 2019
a712450
Hack to make things work for laplacian on borders ...
servantftechnicolor Dec 13, 2019
12689a1
[hdri] laguerre: fix incorrect Laguerre formula
fabiencastan Dec 13, 2019
a8fdf6f
[nodes] LDRToHDR: rename param to nbBrackets
fabiencastan Dec 13, 2019
c274b68
[sfmDataIO] disable resize heuristic as RAW images have a different s…
fabiencastan Dec 13, 2019
414ef86
Add option for compositer Type
servantftechnicolor Dec 16, 2019
df44721
compute seams globally and not iteratively
servantftechnicolor Dec 16, 2019
b41730d
forgot a debug output
servantftechnicolor Dec 16, 2019
587aacf
remove user file
fabiencastan Dec 16, 2019
2e7d7ac
[software] panoramaExternalInfo: update log
fabiencastan Dec 16, 2019
c0cd659
Change upscale function
servantftechnicolor Dec 18, 2019
ba8082b
numerical problem for bounding box when we exactly cross the loop
servantftechnicolor Dec 18, 2019
420d74f
add loop on upscale gaussian
servantftechnicolor Dec 18, 2019
a0a1d64
Merge branch 'dev_hdri_stitching' of https://github.com/alicevision/A…
fabiencastan Dec 18, 2019
0698c38
[software] PanoramaWarping: fix potential out-of-range access to arra…
fabiencastan Jan 3, 2020
66a2bec
[image] RGBA constructor: avoid auto alpha
fabiencastan Jan 3, 2020
790af00
minor code clean
fabiencastan Jan 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ Production
*.tgz
*.tar*

.vscode/settings.json
184 changes: 184 additions & 0 deletions src/aliceVision/camera/Equidistant.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
// This file is part of the AliceVision project.
// Copyright (c) 2016 AliceVision contributors.
// Copyright (c) 2012 openMVG 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/numeric/numeric.hpp>
#include <aliceVision/camera/cameraCommon.hpp>
#include <aliceVision/camera/IntrinsicBase.hpp>
#include <aliceVision/geometry/Pose3.hpp>
#include <aliceVision/multiview/projection.hpp>

#include <vector>
#include <sstream>


namespace aliceVision {
namespace camera {

/// Define an equidistant camera (store a K 3x3 matrix)
/// with intrinsic parameters defining the K calibration matrix
class Equidistant : public IntrinsicBase
{
public:

Equidistant() = default;

Equidistant(
unsigned int w, unsigned int h,
const Mat3 K)
:IntrinsicBase(w,h)
{
_K = K;
_Kinv = _K.inverse();
}

Equidistant(
unsigned int w, unsigned int h,
double focal_length_pix,
double ppx, double ppy, const std::vector<double>& distortionParams = {})
: IntrinsicBase(w,h)
, _distortionParams(distortionParams)
{
setK(focal_length_pix, ppx, ppy);
}

virtual ~Equidistant() {}

virtual Equidistant* clone() const override { return new Equidistant(*this); }
virtual void assign(const IntrinsicBase& other) override { *this = dynamic_cast<const Equidistant&>(other); }

virtual bool isValid() const override { return focal() > 0 && IntrinsicBase::isValid(); }

virtual EINTRINSIC getType() const override { return EQUIDISTANT_CAMERA; }
std::string getTypeStr() const { return EINTRINSIC_enumToString(getType()); }

double getFocalLengthPix() const { return _K(0,0); }

Vec2 getPrincipalPoint() const { return Vec2(_K(0,2), _K(1,2)); }

const Mat3& K() const { return _K; }
const Mat3& Kinv() const { return _Kinv; }
void setK(double focal_length_pix, double ppx, double ppy)
{
_K << focal_length_pix, 0., ppx, 0., focal_length_pix, ppy, 0., 0., 1.;
_Kinv = _K.inverse();
}
void setK(const Mat3 &K) { _K = K;}
/// Return the value of the focal in pixels
inline double focal() const {return _K(0,0);}
inline Vec2 principal_point() const {return Vec2(_K(0,2), _K(1,2));}

// Get bearing vector of p point (image coord)
Vec3 operator () (const Vec2& p) const override
{
Vec3 p3(p(0),p(1),1.0);
return (_Kinv * p3).normalized();
}

// Transform a point from the camera plane to the image plane
Vec2 cam2ima(const Vec2& p) const override
{
return focal() * p + principal_point();
}

// Transform a point from the image plane to the camera plane
Vec2 ima2cam(const Vec2& p) const override
{
return ( p - principal_point() ) / focal();
}

virtual bool have_disto() const override { return false; }

virtual Vec2 add_disto(const Vec2& p) const override { return p; }

virtual Vec2 remove_disto(const Vec2& p) const override { return p; }

virtual double imagePlane_toCameraPlaneError(double value) const override
{
return value / focal();
}

virtual Mat34 get_projective_equivalent(const geometry::Pose3 & pose) const override
{
Mat34 P;
P_From_KRt(K(), pose.rotation(), pose.translation(), &P);
return P;
}

// Data wrapper for non linear optimization (get data)
std::vector<double> getParams() const override
{
std::vector<double> params = {_K(0,0), _K(0,2), _K(1,2)};
params.insert(params.end(), _distortionParams.begin(), _distortionParams.end());
return params;
}

bool hasDistortion() const override
{
for(double d: _distortionParams)
if(d != 0.0)
return true;
return false;
}

const std::vector<double>& getDistortionParams() const
{
return _distortionParams;
}

void setDistortionParams(const std::vector<double>& distortionParams)
{
if(distortionParams.size() != _distortionParams.size())
{
std::stringstream s;
s << "Pinhole::setDistortionParams: wrong number of distortion parameters (expected: " << _distortionParams.size() << ", given:" << distortionParams.size() << ").";
throw std::runtime_error(s.str());
}
_distortionParams = distortionParams;
}

// Data wrapper for non linear optimization (update from data)
bool updateFromParams(const std::vector<double>& params) override
{
if (params.size() != (3 + _distortionParams.size()))
return false;

this->setK(params[0], params[1], params[2]);
setDistortionParams({params.begin() + 3, params.end()});

return true;
}

/**
* @brief Return true if this ray should be visible in the image
* @return true if this ray is visible theorically
*/
virtual bool isVisibleRay(const Vec3 & ray) const override {

if (ray(2) < 0) {
return false;
}

return true;
}

/// Return the un-distorted pixel (with removed distortion)
virtual Vec2 get_ud_pixel(const Vec2& p) const override {return p;}

/// Return the distorted pixel (with added distortion)
virtual Vec2 get_d_pixel(const Vec2& p) const override {return p;}

private:
// Focal & principal point are embed into the calibration matrix K
Mat3 _K, _Kinv;
protected:
std::vector<double> _distortionParams;
};

} // namespace camera
} // namespace aliceVision
59 changes: 59 additions & 0 deletions src/aliceVision/camera/IntrinsicBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,20 @@ struct IntrinsicBase
return this->cam2ima( X.head<2>()/X(2) );
}

inline Vec3 backproject(const geometry::Pose3& pose, const Vec2& pt2D, double depth, bool applyUndistortion = true) const
{
Vec2 pt2DCam;
if (applyUndistortion && this->have_disto()) // apply disto & intrinsics
pt2DCam = this->ima2cam(this->remove_disto(pt2D));
else
pt2DCam = this->ima2cam(pt2D);

const Vec3 pt2DCamN = pt2DCam.homogeneous().normalized();
const Vec3 pt3d = depth * pt2DCamN;
const Vec3 output = pose.inverse()(pt3d);
return output;
}

/**
* @brief Compute the residual between the 3D projected point X and an image observation x
* @param[in] pose The pose
Expand Down Expand Up @@ -335,6 +349,40 @@ struct IntrinsicBase
return false;
}

/**
* @brief Return true if this ray should be visible in the image
* @param ray input ray to check for visibility
* @return true if this ray is visible theorically
*/
virtual bool isVisibleRay(const Vec3 & ray) const = 0;

/**
* @brief Return true if these pixel coordinates should be visible in the image
* @param pix input pixel coordinates to check for visibility
* @return true if visible
*/
virtual bool isVisible(const Vec2 & pix) const {

if (pix(0) < 0 || pix(0) >= _w || pix(1) < 0 || pix(1) >= _h) {
return false;
}

return true;
}

/**
* @brief Assuming the distortion is a function of radius, estimate the
* maximal undistorted radius for a range of distorted radius.
* @param min_radius the minimal radius to consider
* @param max_radius the maximal radius to consider
* @return the maximal undistorted radius
*/
virtual float getMaximalDistortion(double min_radius, double max_radius) const {

/*Without distortion, obvious*/
return max_radius;
}

/**
* @brief Generate an unique Hash from the camera parameters (used for grouping)
* @return Unique Hash from the camera parameters
Expand All @@ -352,6 +400,16 @@ struct IntrinsicBase
return seed;
}

/**
* @brief Rescale intrinsics to reflect a rescale of the camera image
* @param factor a scale factor
*/
virtual void rescale(float factor) {

_w = (unsigned int)(floor(float(_w) * factor));
_h = (unsigned int)(floor(float(_h) * factor));
}

private:

/// initialization mode
Expand Down Expand Up @@ -415,5 +473,6 @@ inline double AngleBetweenRays(const geometry::Pose3& pose1,
return AngleBetweenRays(ray1, ray2);
}


} // namespace camera
} // namespace aliceVision
Loading