Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch_match_stereo CUDA for pinhole camera #16

Open
tiziano-v opened this issue Feb 28, 2020 · 1 comment
Open

patch_match_stereo CUDA for pinhole camera #16

tiziano-v opened this issue Feb 28, 2020 · 1 comment

Comments

@tiziano-v
Copy link

Hi there! I'm trying to use patch_match_stereo in CUDA to compute my depth map from a pair of frames captured using a stereo camera (pinhole camera). I managed to get some results from the code, but actually they seem just the texture of the rigth frame that i'm giving as input and not the correct overlap between the 2 frames. Could you please give me some explanation about the code and how to tune/use correctly the parameters and the inputs?
Currently i'm setting:
MatchMetric match_metric_ = MatchMetric::kZNCC;
int context_radius_ = 2;
float min_initial_depth_ = 0.0022f;
float max_initial_depth_ = 20.0f;
int iteration_count_ = 30;
float max_normal_2d_length_ = 2.0f;

My inputs are:
left and rigth frames from calibrated stereo camera;
fx, fy, cx, cy for Pin-hole camera parameters;
The roto-translation matrix between the 2 camera and its inverse;
CUDAUnprojectionLookup2D reference_unprojection (stereo_camera, cudaStream);

If you need something else i'll provide it immediately.
Thank you very much!

@puzzlepaint
Copy link
Owner

Does this have to do with surfelmeshing? I actually don't know whether the patch match stereo code in libvis works in the version of libvis which is in this repository, I guess it shouldn't be used anywhere in this application unless I forgot about it?

However, in the version of libvis in the camera_calibration repository, it should definitely work (although by default it is compiled to use a generic camera model). See stereo_depth_estimation.cc for an example of how to use it. In the float2 Project(float3 position) function in pixel_corner_projector.cuh, the camera model is hard-coded in this version. There are lots of commented-out sections of the code for various camera models. The pinhole model seems to be right at the start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants