kewlbear / Open3D-iOS

Swift package for using Open3D in iOS apps
MIT License
63 stars 34 forks source link

cannot read images #17

Closed yanyan-li closed 3 years ago

yanyan-li commented 3 years ago

Hi, kewlbear, I am new to iOS development. Thank you for your great work. Currently, we use this package to do 3D reconstruction, which can be compiled successfully but will affect other steps, for example, we cannot save rgbd images from opencv. Very wired. BTW, what is the version of this package? I want to check whether there are any new changes.

        std::string rgb_file_name = "path_rgb.png";
        std::string depth_file_name = "path_depth.png";
        open3d::geometry::Image o_depth, o_color;

        bool  bColor = open3d::io::ReadImage(rgb_file_name, o_color);
        bool  bDepth = open3d::io::ReadImage(depth_file_name, o_depth);

        // merge rgb amd depth images into rgbd
        auto rgbd = open3d::geometry::RGBDImage(o_color, o_depth);

        open3d::camera::PinholeCameraIntrinsic intrisic_ (o_color.width_, o_color.height_, fx, fy, cx, cy);

        volume.Integrate(rgbd, intrisic_, extrinsic);
kewlbear commented 3 years ago

As you can see at https://github.com/kewlbear/Open3D, It is built from v0.12.0.

Can you provide a minimal project to reproduce the problem? In your code snippet above, where the problem occurs? Any error message/code for the problem?

yanyan-li commented 3 years ago

Hi, thanks for your reply. I want to use open3d Image to read rgb and depth maps from my iPhone memory. It seems that the following lines cannot do that, even there are no errors in the compiling process.

open3d::io::ReadImage(rgb_file_name, o_color);
open3d::io::ReadImagePNG(rgb_file_name, o_color);

Do you have any suggestions for reading images?

kewlbear commented 3 years ago

Does ReadImage() return true, meaning success? Where did the file come from?