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

Function as_grayscale

tools/python/src/image.cpp:228–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228py::array as_grayscale(
229 const py::array& img
230)
231{
232 if (is_image<rgb_pixel>(img))
233 {
234 numpy_image<unsigned char> out;
235 assign_image(out, numpy_image<rgb_pixel>(img));
236 return out;
237 }
238 else
239 {
240 return img;
241 }
242}
243
244// ----------------------------------------------------------------------------------------
245

Callers

nothing calls this directly

Calls 1

assign_imageFunction · 0.50

Tested by

no test coverage detected