MCPcopy Create free account
hub / github.com/davisking/dlib / is_vector

Function is_vector

tools/python/src/image4.cpp:572–588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

570
571template <typename T>
572bool is_vector(
573 const py::array_t<T>& m
574)
575{
576 const size_t dims = m.ndim();
577 const size_t size = m.size();
578 if (dims == 1)
579 return true;
580
581 for (size_t i = 0; i < dims; ++i)
582 {
583 if (m.shape(i) != 1 && m.shape(i) != size)
584 return false;
585 }
586
587 return true;
588}
589
590template <typename T>
591py::tuple py_spatially_filter_image_separable (

Callers 1

Calls 3

ndimMethod · 0.45
sizeMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected