libNumerics/computeH.cpp
/// Unwrap parameters in \a h into vector of unknowns \a v.
Unwrap parameters in \a h into vector of unknowns \a v.
Unwrap parameters in \ a h into vector of unknowns \ a v .
void ComputeH::unwrap(const Homography& h, vector<double>& v) const
{
    int i = 0;
    if(_type != Translation) {
        v(i++) = h.mat()(0,0);
        if(_type != Zoom) {
            if(_type != GeneralZoom) {
                v(i++) = h.mat()(0,1); 
                if(n >= 6) 
                    v(i++) = h.mat()(1,0);
            }
            if(_type==GeneralZoom || _type==Affine || _type==Projective)
                v(i++) = h.mat()(1,1);
        }
    }
    v(i++) = h.mat()(0,2);
    v(i++) = h.mat()(1,2);
    if(_type == Projective) {
        v(i++) = h.mat()(2,0);
        v(i++) = h.mat()(2,1);
    }
}
void ComputeH :: unwrap ( const Homography & h , vector < double > & v ) const { int i = 0 ; if ( _type != Translation ) { v ( i ++ ) = h . mat ( ) ( 0 , 0 ) ; if ( _type != Zoom ) { if ( _type != GeneralZoom ) { v ( i ++ ) = h . mat ( ) ( 0 , 1 ) ; if ( n >= 6 ) v ( i ++ ) = h . mat ( ) ( 1 , 0 ) ; } if ( _type == GeneralZoom || _type == Affine || _type == Projective ) v ( i ++ ) = h . mat ( ) ( 1 , 1 ) ; } } v ( i ++ ) = h . mat ( ) ( 0 , 2 ) ; v ( i ++ ) = h . mat ( ) ( 1 , 2 ) ; if ( _type == Projective ) { v ( i ++ ) = h . mat ( ) ( 2 , 0 ) ; v ( i ++ ) = h . mat ( ) ( 2 , 1 ) ; } }
Unwrap parameters in \a h into vector of unknowns \a v.
Unwrap parameters in \ a h into vector of unknowns \ a v .
// Rotation or Similarity or... // Affine or Projective