cgv
|
pinhole camera including distortion according to Brown-Conrady model More...
#include <camera.h>
Public Member Functions | |
distorted_pinhole () | |
standard constructor initializes to no distortion | |
template<typename S > | |
distorted_pinhole (const distorted_pinhole< S > &dp) | |
copy constructor | |
distortion_result | apply_distortion_model (const fvec< T, 2 > &xd, fvec< T, 2 > &xu, fmat< T, 2, 2 > *J_ptr=0, T epsilon=distortion_inversion_epsilon< T >()) const |
apply distortion model from distorted to undistorted image coordinates used in projection direction and return whether successful | |
distortion_inversion_result | invert_distortion_model (const fvec< T, 2 > &xu, fvec< T, 2 > &xd, bool use_xd_as_initial_guess=false, unsigned *iteration_ptr=0, T epsilon=distortion_inversion_epsilon< T >(), unsigned max_nr_iterations=get_standard_max_nr_iterations(), T slow_down=get_standard_slow_down()) const |
invert model for image coordinate inversion | |
template<typename S > | |
void | compute_distortion_map (std::vector< cgv::math::fvec< S, 2 > > &map, unsigned sub_sample=1, const cgv::math::fvec< S, 2 > &invalid_point=cgv::math::fvec< S, 2 >(S(-10000)), T epsilon=distortion_inversion_epsilon< T >(), unsigned max_nr_iterations=get_standard_max_nr_iterations(), T slow_down=get_standard_slow_down()) const |
compute for all pixels the distorted image coordinates with the invert_distortion_model() function and store it in a distortion map | |
![]() | |
pinhole () | |
standard constructor | |
template<typename S > | |
pinhole (const pinhole< S > &ph) | |
copy constructor | |
fmat< T, 2, 3 > | get_camera_matrix () const |
fmat< T, 3, 3 > | get_squared_camera_matrix () const |
fmat< T, 4, 4 > | get_homogeneous_camera_matrix () const |
fvec< T, 2 > | image_to_pixel_coordinates (const fvec< T, 2 > &x) const |
fvec< T, 2 > | pixel_to_image_coordinates (const fvec< T, 2 > &p) const |
bool | estimate_parameters (const std::vector< fmat< T, 3, 3 > > &Hs, bool quadratic_pixels=true, bool no_skew=true) |
Static Public Member Functions | |
static T | get_standard_slow_down () |
slow down factor [0,1] to decrease step size during inverse Jacobian stepping | |
![]() | |
static unsigned | get_standard_max_nr_iterations () |
default maximum number of iterations used for inversion of distortion models | |
Public Attributes | |
fvec< T, 2 > | dc |
T | k [6] |
T | p [2] |
T | max_radius_for_projection = T(10) |
![]() | |
unsigned | w |
unsigned | h |
fvec< T, 2 > | s |
fvec< T, 2 > | c |
T | skew = 0.0f |
Additional Inherited Members | |
![]() | |
enum class | distortion_result { success , out_of_bounds , division_by_zero } |
possible results of applying distortion model More... | |
enum class | distortion_inversion_result { convergence , max_iterations_reached , divergence , out_of_bounds , division_by_zero } |
possible results of inverting distortion model More... | |
pinhole camera including distortion according to Brown-Conrady model
|
inline |
|
inline |
|
inline |
apply distortion model from distorted to undistorted image coordinates used in projection direction and return whether successful
Failure cases are zero denominator in distortion formula or radius larger than max projection radius.
Definition at line 427 of file camera.h.
Referenced by cgv::math::distorted_pinhole< T >::invert_distortion_model().
|
inline |
compute for all pixels the distorted image coordinates with the invert_distortion_model() function and store it in a distortion map
The distortion map can be computed to speed up distortion model inversion if these are used multiple times per pixel. Given the pixel coordinates x and y and the image width w the distorted image coordinate is looked up via distortion_map[w*y+x]. For pixels where the inversion of the distortion model failed, the invalid_point is stored. Further parameters are passed on the the invert_distortion_model() function.
Definition at line 529 of file camera.h.
References cgv::math::distorted_pinhole< T >::invert_distortion_model().
|
inlinestatic |
|
inline |
invert model for image coordinate inversion
xu | input ... undistorted image coordinates |
xd | output ... distorted image coordinates |
use_xd_as_initial_guess | if true the passed values in xd are used as initial guess, otherwise a pseudo inversion of the distortion model is used as initial guess |
iteration_ptr | if provided, the passed index is used as iteration counter and indicates after the call how many iterations have been performed |
epsilon | epsilon used to detect division by zero and convergence |
max_nr_iterations | maximum number of to be taken iterations |
slow_down | factor in [0,1] to decrease step estimated by Jacobian inverse |
Definition at line 469 of file camera.h.
References cgv::math::distorted_pinhole< T >::apply_distortion_model(), and cgv::math::fvec< T, N >::sqr_length().
Referenced by cgv::math::distorted_pinhole< T >::compute_distortion_map().
fvec<T,2> cgv::math::distorted_pinhole< T >::dc |
T cgv::math::distorted_pinhole< T >::k[6] |
T cgv::math::distorted_pinhole< T >::max_radius_for_projection = T(10) |
T cgv::math::distorted_pinhole< T >::p[2] |