| 21 | namespace depthMap { |
| 22 | |
| 23 | void copyFloat2Map(image::Image<float>& out_mapX, |
| 24 | image::Image<float>& out_mapY, |
| 25 | const CudaHostMemoryHeap<float2, 2>& in_map_hmh, |
| 26 | const ROI& roi, |
| 27 | int downscale) |
| 28 | { |
| 29 | const ROI downscaledROI = downscaleROI(roi, downscale); |
| 30 | const int width = int(downscaledROI.width()); |
| 31 | const int height = int(downscaledROI.height()); |
| 32 | |
| 33 | // resize output images |
| 34 | out_mapX.resize(width, height); |
| 35 | out_mapY.resize(width, height); |
| 36 | |
| 37 | // copy image from host memory to output images |
| 38 | for (int x = 0; x < width; ++x) |
| 39 | { |
| 40 | for (int y = 0; y < height; ++y) |
| 41 | { |
| 42 | const float2& value = in_map_hmh(size_t(x), size_t(y)); |
| 43 | out_mapX(y, x) = value.x; |
| 44 | out_mapY(y, x) = value.y; |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | void copyFloat2Map(image::Image<float>& out_mapX, |
| 50 | image::Image<float>& out_mapY, |