Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- F200 camera multi-user ego-centric dataset
- const auto FX = 478.01f;
- const auto FY = 478.01f;
- const auto CX = 321.59f;
- const auto CY = 250.55f;
- */
- /*
- * Creative Senz 3D camera CVAR dataset
- * fx=224.5, fy=230.5, ux=160, uy=120
- */
- const auto FX = 224.5f;
- const auto FY = 230.5f;
- const auto CX = 160.0f;
- const auto CY = 120.0f;
- vector<Point3f> xyzBuffer;
- auto depth_image = imread("C:\\OpenARK\\OpenARK-test\\000000_depth.png", IMREAD_ANYDEPTH);
- namedWindow("depth", WINDOW_AUTOSIZE);
- imshow("depth", depth_image);
- //waitKey(0);
- cout << "n rows depth: " << depth_image.rows << endl;
- cout << "n cols depth: " << depth_image.cols << endl;
- cout << "depth type: " << depth_image.type() << endl;
- for (auto v = 0; v < depth_image.rows; v++) {
- for (auto u = 0; u < depth_image.cols; u++) {
- auto depth_value = depth_image.at<uint16_t>(v, u);
- Point3f p;
- p.x = ((u - CX)*depth_value*(1.0f / FX)) / 32000.0f;
- p.y = ((v - CY)*depth_value*(1.0f / FY)) / 32000.0f;
- p.z = (depth_value) / 32000.0f;
- xyzBuffer.emplace_back(p);
- }
- }
- xyzMap = Mat(xyzBuffer, true).reshape(3, 240);
- namedWindow("xyz Map", WINDOW_AUTOSIZE);
- imshow("xyz Map", xyzMap);
- //waitKey(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement