fixstars / libSGM

Stereo Semi Global Matching by cuda
Apache License 2.0
596 stars 187 forks source link

Upload cuda::GpuMat directly to SGM? #16

Open AFIDclan opened 6 years ago

AFIDclan commented 6 years ago

Is there a way I can feed a GPU mat directly into the SGM function? Right now I have to download my GPU mat to a CPU mat then push it through the SGM function so it can (presumably) re-upload it to the GPU. Seems kinda inefficient.

AFIDclan commented 6 years ago

I seem to be having problems with speed. I'm on a nvidia TX1 and getting 3 FPS with a 1280x720 image pair. Is that normal? (350 ms per image)

ghost commented 6 years ago

The libSGM doesn't have interface to pass cuda::GpuMat directly now.

Speed seems to be suitable if disparity is 128. Our environment, when running with 1024x440 images and 128 disparity, consume 282ms. http://proc-cpuinfo.fixstars.com/2015/12/realizing-self-driving-cars-with-html-2/ (Table 1)

AFIDclan commented 6 years ago

Thanks for the reply! My disparity is currently at 64 with those results but I suppose that's what the table expects. Opencv really needs to natively use your libary. Its great!!

saudet commented 6 years ago

@AFIDclan Sounds like a great idea! Maybe we could send a pull request to https://github.com/opencv/opencv_contrib/tree/master/modules/stereo ? The barrier to get a patch accepted in that repository seem especially low.

AFIDclan commented 6 years ago

That would be nice. There seem to be a lot of people looking for this library 😄