Код: Выделить всё
auto [depthBytes, resolution] = sim.getVisionSensorDepth(CameraHandle,1);
int width = static_cast(resolution[0]);
int hight = static_cast(resolution[1]);
vector depth_in_float(width*hight);
memcpy(depth_in_float.data(),depthBytes.data(),width*hight*sizeof(float));
for (int i(0); i < depth_in_float.size(); ++i)
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79757127/problem-with-vector-of-uint8-t-to-vector-of-double[/url]
Мобильная версия