mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Added inv() that invert point transformation functions.
This commit is contained in:
parent
01fa1f223e
commit
478af745de
@ -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
|
||||
|
@ -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 (
|
||||
|
Loading…
Reference in New Issue
Block a user