Added inv() that invert point transformation functions.

This commit is contained in:
Davis King 2013-11-13 19:50:15 -05:00
parent 01fa1f223e
commit 478af745de
2 changed files with 41 additions and 0 deletions

View File

@ -126,6 +126,16 @@ namespace dlib
dlib::vector<double,2> b;
};
// ----------------------------------------------------------------------------------------
inline point_transform_affine inv (
const point_transform_affine& trans
)
{
matrix<double,2,2> im = inv(trans.get_m());
return point_transform_affine(im, -im*trans.get_b());
}
// ----------------------------------------------------------------------------------------
template <typename T>
@ -203,6 +213,15 @@ namespace dlib
matrix<double,3,3> m;
};
// ----------------------------------------------------------------------------------------
inline point_transform_projective inv (
const point_transform_projective& trans
)
{
return point_transform_projective(inv(trans.get_m()));
}
// ----------------------------------------------------------------------------------------
namespace impl_proj

View File

@ -57,6 +57,17 @@ namespace dlib
};
// ----------------------------------------------------------------------------------------
point_transform_affine inv (
const point_transform_affine& trans
);
/*!
ensures
- If trans is an invertible transformation then this function returns a new
transformation that is the inverse of trans.
!*/
// ----------------------------------------------------------------------------------------
template <typename T>
@ -134,6 +145,17 @@ namespace dlib
};
// ----------------------------------------------------------------------------------------
point_transform_projective inv (
const point_transform_projective& trans
);
/*!
ensures
- If trans is an invertible transformation then this function returns a new
transformation that is the inverse of trans.
!*/
// ----------------------------------------------------------------------------------------
point_transform_projective find_projective_transform (