nvxFastTrackNode change threshold value between graph executions


I want to adapt the number of keypoints extracted at runtime with nvxFastTrackNode (VisionWorks For that, I’m trying to change the value of the threshold parameter between graph executions, based on the number of extracted keypoints at the previous execution.

I’m calling the following in between graph executions

fast_thresh_ = getUpdatedThreshold();
vxSetParameterByIndex(fast_node_, 7, vx_reference(&fast_thresh_))

but at runtime I get:

vxSetParameterByIndex: invalid value reference

Alternatively, in the documentation, it states that:

node parameter objects may be modified by retrieving the reference to the vx_parameter via vxGetParameterByIndex, and then passing that to vxQueryParameter to retrieve the reference to the object.

with :

vx_parameter param = vxGetParameterByIndex(node_, 7);
vx_reference ref;
vxQueryParameter(param, VX_PARAMETER_REF, &ref, sizeof(ref));

But then how do I change the value pointed by the reference ?

Thanks for your help.