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

Function cv_from_object

tools/python/src/vector.cpp:55–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55std::shared_ptr<cv> cv_from_object(py::object obj)
56{
57 try {
58 long nr = obj.cast<long>();
59 auto temp = std::make_shared<cv>(nr);
60 *temp = 0;
61 return temp;
62 } catch(py::cast_error&) {
63 py::list li = obj.cast<py::list>();
64 const long nr = len(obj);
65 auto temp = std::make_shared<cv>(nr);
66 for ( long r = 0; r < nr; ++r)
67 {
68 (*temp)(r) = li[r].cast<double>();
69 }
70 return temp;
71 }
72}
73
74long cv__len__(cv& c)
75{

Callers

nothing calls this directly

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected