This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-J721E: Difference in the output of tivxVpacMscScaleNode and tivxVpacMscPyramidNode

Part Number: PROCESSOR-SDK-J721E


Hi,

For one of the applications we required scaled output images. As part of that, we achieved the scaled images using two different approaches one using the tivxVpacMscScaleNode and the other using the tivxVpacMscPyramidNode. We observed difference(not bit matching) in the output between the above said approaches even though the interpolation is configured the same.  

Is this expected (or) what are the other things needed to be configured to achieve similar outputs from both of these approaches?


Thanks and Regards,

Kirubakaran K.

  • Kirubakaran,

    Can you please provide some more details, as to what difference you are observing? If the input is same and configuration is same, including coefficients, then output will be same. 

    There could be difference in the pyramid node if the number of levels are more.. because then the node does iterative scaling.. 

    Regards,

    Brijesh

  • We are actually using the error frame at the capture node. So, it is the same frame given as input to the graph for both the cases. Despite the same configurations, we observe the msc dumps are not bit exact(but subjectively it looks similar). 

    The scalar node configuration is done as follows:

    tivx_vpac_msc_coefficients_t sc_coeffs;
    vx_reference refs[1];
    obj->scaler_out_img[1] = vxCreateImage(obj->context, image_width / 2, image_height / 2, VX_DF_IMAGE_U8);
    obj->scaler_out_img[2] = vxCreateImage(obj->context, image_width / 4, image_height / 4, VX_DF_IMAGE_U8);
    obj->scalerNode[0] = tivxVpacMscScaleNode(obj->graph_ir, obj->y8_r8_c2_ir, obj->scaler_out_img[0], obj->scaler_out_img[1], obj->scaler_out_img[2], NULL, NULL);
    (void)tivxSetNodeParameterNumBufByIndex(obj->scalerNode[0], 1u, obj->num_cap_buf);
    (void)vxSetNodeTarget(obj->scalerNode[0], VX_TARGET_STRING, TIVX_TARGET_VPAC_MSC1);
    tivx_vpac_msc_coefficients_params_init(&sc_coeffs, VX_INTERPOLATION_BILINEAR);
    obj->sc_coeff_obj = vxCreateUserDataObject(obj->context, "tivx_vpac_msc_coefficients_t", sizeof(tivx_vpac_msc_coefficients_t), NULL);
    (void)vxCopyUserDataObject(obj->sc_coeff_obj, 0, sizeof(tivx_vpac_msc_coefficients_t), &sc_coeffs, VX_WRITE_ONLY, VX_MEMORY_TYPE_HOST);
    refs[0] = (vx_reference)obj->sc_coeff_obj;
    (void)tivxNodeSendCommand(obj->scalerNode[0], 0u, TIVX_VPAC_MSC_CMD_SET_COEFF, refs, 1u);



    The pyramid node configuration is done as follows:

    vx_user_data_object coeff_obj;
    tivx_vpac_msc_coefficients_t coeffs;
    vx_reference refs[1];
    obj->pyramid = vxCreatePyramid(obj->context, MAX_NUM_SCALER_OUT, VX_SCALE_PYRAMID_HALF, image_width, image_height, VX_DF_IMAGE_U8);
    obj->pyramid_node = tivxVpacMscPyramidNode(obj->graph_ir, obj->y8_r8_c2_ir, obj->pyramid);
    (void)vxSetNodeTarget(obj->pyramid_node, VX_TARGET_STRING, TIVX_TARGET_VPAC_MSC1);
    tivx_vpac_msc_coefficients_params_init(&coeffs, VX_INTERPOLATION_BILINEAR);
    coeff_obj = vxCreateUserDataObject(obj->context"tivx_vpac_msc_coefficients_t"sizeof(tivx_vpac_msc_coefficients_t), NULL);
    vxCopyUserDataObject(coeff_obj, 0sizeof(tivx_vpac_msc_coefficients_t), &coeffs, VX_WRITE_ONLYVX_MEMORY_TYPE_HOST);
    refs[0] = (vx_reference)coeff_obj;
    tivxNodeSendCommand(obj->pyramid_node, 0u, TIVX_VPAC_MSC_CMD_SET_COEFF,refs, 1u);
    vxReleaseUserDataObject(&coeff_obj);


    As we can see, I have used "VX_DF_IMAGE_U8" image type and "VX_INTERPOLATION_BILINEAR" interpolation in both the cases, I still see the difference in the msc dumps between the two.

    Thanks and Regards,
    Kirubakaran K.
  • Kirubakaran,

    Are you still facing this issue? 

    Internally both the nodes use the same HW block, so as long as config is same, it would give same output..

    Can you please make sure to provide/use same configuration & scaling coefficients and downscaling resolution on both the cases ?

    Regards,

    Brijesh