Commit 478af745 authored by Davis King's avatar Davis King

Added inv() that invert point transformation functions.

parent 01fa1f22
...@@ -126,6 +126,16 @@ namespace dlib ...@@ -126,6 +126,16 @@ namespace dlib
dlib::vector<double,2> b; 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> template <typename T>
...@@ -203,6 +213,15 @@ namespace dlib ...@@ -203,6 +213,15 @@ namespace dlib
matrix<double,3,3> m; 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 namespace impl_proj
......
...@@ -57,6 +57,17 @@ namespace dlib ...@@ -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> template <typename T>
...@@ -134,6 +145,17 @@ namespace dlib ...@@ -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 ( point_transform_projective find_projective_transform (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment