Commit 55b8e5b2 authored by Davis King's avatar Davis King

Added an overload of flip_image_left_right() that operates inplace.

parent b66cf7b2
...@@ -1035,6 +1035,21 @@ namespace dlib ...@@ -1035,6 +1035,21 @@ namespace dlib
return find_affine_transform(from,to); return find_affine_transform(from,to);
} }
// ----------------------------------------------------------------------------------------
template <
typename image_type
>
point_transform_affine flip_image_left_right (
image_type& img
)
{
image_type temp;
auto tform = flip_image_left_right(img, temp);
swap(temp,img);
return tform;
}
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template < template <
......
...@@ -440,6 +440,29 @@ namespace dlib ...@@ -440,6 +440,29 @@ namespace dlib
corresponding location in #out_img. corresponding location in #out_img.
!*/ !*/
// ----------------------------------------------------------------------------------------
template <
typename image_type
>
point_transform_affine flip_image_left_right (
image_type& img
);
/*!
requires
- image_type == an image object that implements the interface defined in
dlib/image_processing/generic_image.h
ensures
- This function is identical to the above version of flip_image_left_right()
except that it operates in-place.
- #img.nr() == img.nr()
- #img.nc() == img.nc()
- #img == a copy of img which has been flipped from left to right.
(i.e. it is flipped as if viewed though a mirror)
- returns a transformation object that maps points in img into their
corresponding location in #img.
!*/
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template < template <
......
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