Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (auto v = 0; v < depth_image.rows; v++) {
- for (auto u = 0; u < depth_image.cols; u++) {
- auto depth_value = depth_image.at<float>(v, u);
- Point3f p;
- p.x = ((u - CX)*depth_value*(1.0f / FX)) / 1000.0f;
- p.y = ((v - CY)*depth_value*(1.0f / FY)) / 1000.0f;
- p.z = (depth_value) / 1000.0f;
- xyzBuffer.emplace_back(p);
- }
- }
- /*(for (auto u = 0; u < depth_image.cols; u++) {
- for (auto v = 0; v < depth_image.rows; v++) {
- auto depth_value = depth_image.at<float>(u, v);
- Point3f p;
- p.x = ((u - CX)*depth_value*(1.0f / FX)) / 1000.0f;
- p.y = ((v - CY)*depth_value*(1.0f / FY)) / 1000.0f;
- p.z = (depth_value) / 1000.0f;
- xyzBuffer.emplace_back(p);
- }
- }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement