Commit 1619725f authored by Davis King's avatar Davis King

Improved input validation for numpy_image.

parent e83f3503
...@@ -163,7 +163,7 @@ namespace dlib ...@@ -163,7 +163,7 @@ namespace dlib
const py::object& rhs const py::object& rhs
) )
{ {
py::array_t<typename pixel_traits<pixel_type>::basic_pixel_type, py::array::c_style> arr = rhs.cast<py::array>(); py::array arr = rhs.cast<py::array>();
assert_is_image<pixel_type>(arr); assert_is_image<pixel_type>(arr);
py::array_t<typename pixel_traits<pixel_type>::basic_pixel_type, py::array::c_style>::operator=(arr); py::array_t<typename pixel_traits<pixel_type>::basic_pixel_type, py::array::c_style>::operator=(arr);
return *this; return *this;
......
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