cv::StereoSGBM::create - How to decide the value of input parameters?

Hello All,

I’m using a stereo camera setup and want to calculate the depth of the object in the image captured by the stereo cameras. For calculating the depth, I would first need a good disparity map, however, there are different input parameters to the cv::StereoSGBM::create function. How can I decide the values of these parameters, to get the accurate depth of the object, if images are captured in different environments like different illumination conditions, less texture environment. Would the parameters value would change for different environment images.

Any information or reply to the post would be helpful.