How to adjust sad parameter in VPI Stereo Disparity Sample Application?

In VisionWorks, I can adjust sad parameter for demo_stereo_matching sample code. But, I can’t find the way in VPI.
Is there any way to adjust sad parameter in VPI Stereo Disparity Sample Application?
I heard VisionWorks will be substituted with VPI.
Please, give me some help.

Hi,

Do you mean the sad parameter in the Stereo Matching Demo App of VisionWorks?

-c, --config

  • sad
    * Parameter: [odd integer greater than or equal to zero and less than or equal to 31]
    * Description: The size of the SAD window. Default is 5.

The parameter will update the window size.
You can find a similar configure in the VPIStereoDisparityEstimatorParams.
https://docs.nvidia.com/vpi/group__VPI__StereoDisparityEstimator.html#structVPIStereoDisparityEstimatorParams

VPIStereoDisparityEstimatorParams params;
params.windowSize   = 5;
params.maxDisparity = 64;
...
vpiSubmitStereoDisparityEstimator(stream, VPI_BACKEND_CUDA, stereo, left, right, disparity, confidence, &params);

Thanks.

Hi,
Thanks a lot for your quick response.
VPI params.windowSize is different from VisionWorks sad parameter.
VPI params.windowSize is ‘Width of Census Transform window for disparity features’, not SAD window size.
VisionWorks’s Census window size parameter is ’ vx_int32 ct_win_size’.

Here is the Visionworks StereoMatchingParams below.

– stereo_matching.hpp –
#include <VX/vx.h>

class StereoMatching
{
public:

enum ImplementationType
{
    HIGH_LEVEL_API,
    LOW_LEVEL_API,
    LOW_LEVEL_API_PYRAMIDAL
};

struct StereoMatchingParams
{
    // disparity range
    vx_int32 min_disparity;
    vx_int32 max_disparity;

    // discontinuity penalties
    vx_int32 P1;
    vx_int32 P2;

    **// SAD window size**

** vx_int32 sad;**

    **// Census Transform window size**

** vx_int32 ct_win_size;**

    // Hamming cost window size
    vx_int32 hc_win_size;

    // BT-cost clip value
    vx_int32 bt_clip_value;

    // validation threshold
    vx_int32 max_diff; // cross-check
    vx_int32 uniqueness_ratio;

    vx_enum scanlines_mask;

    vx_enum flags;

    StereoMatchingParams();
};

Hi,

Thanks for the correction.

We are checking this with our internal team.
Will share more information with you later.

Hi,

Currently, VPI assumes the SAD value to be 1.
Thanks.

Thanks a lot your response.
I hope SAD value could be changed by user like the case of vision_works.
Is it on your plan?

Hi,

Yes, we are going to add this feature.
We will let you know once it is done.

Thanks.

2 Likes