这种方法效率高点:
memcpy 需要从0位置开始拷贝,目标,起始位置,长度。
uint8_t *p = pFrameRGB->data[0];
std::vector<ssize_t> shape{ 720, 1280,3 };
auto dtype = py::dtype("uint8");
auto vptr = (uint8_t *)pFrameRGB->data;
//py::array_t<uint8_t> result =py::array(dtype, shape, (uint8_t *)pFrameRGB->data);
py::array_t<uint8_t> result( 720*1280* 3 );//h w c
//std:s:fill(result.mutable_data(), vptr, 720 * 1280 * 3);
memcpy(result.mutable_data(), pFrameRGB->data[0], 720 * 1280 * 3);