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

Function py_partition_pixels2

tools/python/src/image.cpp:66–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64
65template <typename T>
66py::tuple py_partition_pixels2 (
67 const numpy_image<T>& img,
68 int num_thresholds
69)
70{
71 DLIB_CASSERT(1 <= num_thresholds && num_thresholds <= 6);
72
73 typename pixel_traits<T>::basic_pixel_type t1,t2,t3,t4,t5,t6;
74
75 switch(num_thresholds)
76 {
77 case 1: partition_pixels(img,t1); return py::make_tuple(t1);
78 case 2: partition_pixels(img,t1,t2); return py::make_tuple(t1,t2);
79 case 3: partition_pixels(img,t1,t2,t3); return py::make_tuple(t1,t2,t3);
80 case 4: partition_pixels(img,t1,t2,t3,t4); return py::make_tuple(t1,t2,t3,t4);
81 case 5: partition_pixels(img,t1,t2,t3,t4,t5); return py::make_tuple(t1,t2,t3,t4,t5);
82 case 6: partition_pixels(img,t1,t2,t3,t4,t5,t6); return py::make_tuple(t1,t2,t3,t4,t5,t6);
83 }
84 DLIB_CASSERT(false, "This should never happen.");
85}
86
87// ----------------------------------------------------------------------------------------
88

Callers

nothing calls this directly

Calls 2

partition_pixelsFunction · 0.85
make_tupleFunction · 0.85

Tested by

no test coverage detected