angli66 / simsense

A Real-Time Depth Sensor Simulator with GPU Acceleration
MIT License
19 stars 3 forks source link

How to parallel computing multiple image pairs? #2

Closed youwyu closed 2 weeks ago

youwyu commented 3 weeks ago

May I ask how to parallel compute multiple image pairs? Such as left and right images with shape [N, height, width].

angli66 commented 3 weeks ago

Hi, currently I don’t have support for batch computing and supporting this would require some modifications to the source code. However there’s a quick hack I can think of: you can stack all of the images in one direction and add enough zero padding (wider than max disparity level) between every two nearby images so that they won’t interfere with each other.

youwyu commented 3 weeks ago

Thank you for your quick and helpful response. This is an easy but good solution. I have a followup: May I ask how can we generate (simulate) test/left1.png since from the whole code I only found the D415 pattern for test/left2.png. The pattern for test/left.png seems like the D435 pattern.

angli66 commented 3 weeks ago

You are right, left1 was taken by a real D435 camera while left2 was simulated with SAPIEN. If you are interested in simulating D435 pattern, you might want to checkout the dev branch of SAPIEN where we include parameters for D435. An example usage can be found here.