Parameters for visionworks semi global matching algorithm


I am trying to evaluate the performance of visionworks 1.6 semi global matching algorithm and have a hard time figuring out the right paramters for the nvxcuSemiGlobalMatching. With below input, I keep getting invalid parameters error. Could the NVIDIA team provide a working example and explain a little more about below parameters and recommended values:

 * \param [in]  P1              Specifies the smoothness penalty.
 * \param [in]  P2              Specifies the discontiguous penalty.
 * \param [in]  sad             Specifies the average window size for sum of absolute differences (set to 1 for original SGM).
 * \param [in]  ct_win_size     Specifies the census transform window size.
 * \param [in]  hc_win_size     Specifies the hamming cost window size.
 * \param [in]  clip            Specifies clip value for cost (used to preserve overflow in cost function)
 * \param [in]  max_diff        Specifies maximum allowed difference (in integer pixel units) in the left-right disparity check.
 * \param [in]  uniqueness      Specifies margin in percentage by which the best (minimum) computed cost function value
 *                                  should “win” the second best value to consider the found match correct.

 nvxcu_error_status_e error = 
                                params_.minDisparity_, // 1
                                params_.maxDisparity_, // 64 
                                params_.smoothnessPenalty_,  // 10??
                                params_.discontiguousPenalty_, // 10??
                                params_.sadWindowSize_, // 5
                                params_.censusTransformWindowSize_, // 5
                                params_.hammingCostWindowSize_,  // 5 
                                params_.clipCostValue_, // 100?? 
                                params_.maxDiffLeftRightDisparityCheck_, // 10?
                                params_.uniquenessScore_, // 75? 
                                (nvxcu_scanline_e)params_.scanLineMask_,// 255
                                (nvxcu_sgm_flags_e)params_.sgmFlag_, // 0

I found a set of parameters from the visionwork examples, with which I can get around the invalid parameters errors (-10). I now have the NVXCU_ERROR_CUDA_FAILURE (-1002) and it could be some mistake within my code. So I am good for now and will report back if I cannot resolve the new error. Thanks

min_disparity = 0
max_disparity = 64
P1 = 8
P2 = 109
sad = 5
bt_clip_value = 31
max_diff = 32000
uniqueness_ratio = 0
scanlines_mask = 85
flags = 2
ct_win_size = 0
hc_win_size = 1


Thanks for updating the status with us.
Here are some information for your reference also:

1. As you already know, nvxcuSemiGlobalMatching usage can be found in the below sample:


You can find the parameters details in our document:

[in] left Specifies the left stereo image. Only NVXCU_DF_IMAGE_U8 format is supported. Only nvxcu_pitch_linear_image_t is supported. Width must be divisible by 4
[in] right Specifies the right stereo image. It must have the same size and format as left . Only nvxcu_pitch_linear_image_t is supported.