22 yCAssert(POINTCLOUDUTILS, depth.width() != 0);
23 yCAssert(POINTCLOUDUTILS, depth.height() != 0);
24 size_t w = depth.width();
25 size_t h = depth.height();
29 for (
size_t u = 0; u < w; ++u) {
30 for (
size_t v = 0; v < h; ++v) {
37 pointCloud(u,v).z = depth.
pixel(u,v);
49 yCAssert(POINTCLOUDUTILS, depth.width() != 0);
50 yCAssert(POINTCLOUDUTILS, depth.height() != 0);
52 size_t max_x = roi.
max_x == 0 ? depth.width() : std::min(roi.
max_x, depth.width());
53 size_t max_y = roi.
max_y == 0 ? depth.height() : std::min(roi.
max_y, depth.height());
54 size_t min_x = std::min(roi.
min_x, max_x);
55 size_t min_y = std::min(roi.
min_y, max_y);
57 step_x = std::max<size_t>(std::min(step_x, max_x - min_x), 1);
58 step_y = std::max<size_t>(std::min(step_y, max_y - min_y), 1);
61 size_t size_x = (max_x - min_x) / step_x;
62 size_t size_y = (max_y - min_y) / step_y;
63 pointCloud.
resize(size_x, size_y);
65 for (
size_t i = 0, u = min_x; u < max_x; i++, u += step_x) {
66 for (
size_t j = 0, v = min_y; v < max_y; j++, v += step_y) {
73 pointCloud(i, j).z = depth.
pixel(u, v);