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.

SK-TDA4VM: how to get the ch2 data when 4 camera input?

Part Number: SK-TDA4VM

hi,

I am develping camera drv.  there are 4 cameras connect to a deserializer . the deserilizer is connected to csi.  using app_multi_cam demo, it can save and display now. my question is:

how could I  get the data of the third channel?  I want to push the data of the third channel  into my  node  A, and push the data of the fourth channel  into my  node B.

could you gwi me some suggestion? or examples?

best regards

li

  • Hi Li,

    Well, it is possible. There is somewhat similar requirement implemented in the display node. Display node can select the input channel from the input object array and can display it. User/Application can provide channel to be displayed as a parameter in control command. 

    Please look into the tivxDisplaySwitchChannel and code below in ti-processor-sdk-rtos-j721e-evm-08_00_00_12\tiovx\kernels_j7\hwa\display\vx_display_target.c file.

    if((vx_status)VX_SUCCESS == status)
    {
    uint32_t active_channel;

    active_channel = displayParams->active_channel;

    obj_desc_image = (tivx_obj_desc_image_t *)
    tivxGetObjDescElement(obj_desc[TIVX_KERNEL_DISPLAY_INPUT_IMAGE_IDX],
    active_channel);

    if (obj_desc_image == NULL)
    {
    status = (vx_status)VX_FAILURE;
    }

    }

    Regards,

    Brijesh

  • hi Brijesh,

    thanks for your reply.

    some more quesutions:

    1. about the function "vxGetObjectArrayItem()": Retrieves the reference to the OpenVX Object in location index of the ObjectArray.

    why "display_in_image = (vx_image)vxGetObjectArrayItem(obj->captureObj.raw_image_arr[0], 1);" does not work?

    2. the first arg type of tivxGetObjDescElement() is tivx_obj_desc_image_t, but capture node output is captureObj.raw_image_arr[0] which type is  vx_object_array. so how can I using the function tivxGetObjDescElement() to get the second camera image from captureObj.raw_image_arr[0]?

    Regards,

    li

  • hi Brijesh,

    some more quesutions:

    1. about the function "vxGetObjectArrayItem()": Retrieves the reference to the OpenVX Object in location index of the ObjectArray.

    why "display_in_image = (vx_image)vxGetObjectArrayItem(obj->captureObj.raw_image_arr[0], 1);" does not work?

    2. the first arg type of tivxGetObjDescElement() is tivx_obj_desc_image_t, but capture node output is captureObj.raw_image_arr[0] which type is  vx_object_array. so how can I using the function tivxGetObjDescElement() to get the second camera image from captureObj.raw_image_arr[0]?

    Regards,

    li

  • Hi dw li,

    1. about the function "vxGetObjectArrayItem()": Retrieves the reference to the OpenVX Object in location index of the ObjectArray.

    why "display_in_image = (vx_image)vxGetObjectArrayItem(obj->captureObj.raw_image_arr[0], 1);" does not work?

    What is the raw_image_arr[0]? Is this the object array of size atleast 2? Then you could get object array item at the index-1.

    2. the first arg type of tivxGetObjDescElement() is tivx_obj_desc_image_t, but capture node output is captureObj.raw_image_arr[0] which type is  vx_object_array. so how can I using the function tivxGetObjDescElement() to get the second camera image from captureObj.raw_image_arr[0]?

    But why do you want to use tivxGetObjDescElement API? Can you help me understand the usecase?

    Regards,

    Brijesh 

  • hi,

    I notice that in  app_multi_cam demo,captureObj->raw_image_arr[q] is created like below:

    for(q = 0; q < bufq_depth; q++)
    {
    captureObj->raw_image_arr[q] = vxCreateObjectArray(context, (vx_reference)raw_image, sensorObj->num_cameras_enabled);
    status = vxGetStatus((vx_reference)captureObj->raw_image_arr[q]);
    if(status != VX_SUCCESS)
    {
    printf("[CAPTURE-MODULE] Unable to create RAW image object array! \n");
    break;
    }
    else
    {
    vx_char name[VX_MAX_REFERENCE_NAME];

    snprintf(name, VX_MAX_REFERENCE_NAME, "capture_node_raw_image_arr_%d", q);

    vxSetReferenceName((vx_reference)captureObj->raw_image_arr[q], name);
    }
    }

    and I set sensorObj->num_cameras_enabled as 4. so I think the object array of size is 4.is it ok?

    I want to get the second camera image. so I do like below:

    second_image = (vx_image)vxGetObjectArrayItem(obj->captureObj.raw_image_arr[0], 1);

    is it OK?

    regards

    li

  • Hi li,

    Yes, this is correct, you would get the second instance of the image from the object array. But where do you use this second instance of the image? Is it used in creating the display node? Then you would require to change the active channel to 1 in the display node, using TIVX_DISPLAY_SELECT_CHANNEL control command. You could find the reference example for this control command usage in ti-processor-sdk-rtos-j721e-evm-08_01_00_13\tiovx\kernels_j7\hwa\test\test_capture_display.c file.

    Regards,

    Brijesh

  • hi ,

    thanks for your reply.

    we want to push each camera image into different deeplearning net. like below:

    cam1 image --->ldc1--->preproc1-->tidl1(object detection net) ---> draw detection node1----->mosic node

    cam2 image --->ldc2--->preproc2-->tidl1(segment net) ---> postproc node1----->mosic node

    cam3 is like cam1 and cam4 is like cam2.

    so my firt step is get the second camera image and display it.and next,I will push the image into my ldc or preproc node.

    best regards

    li

  • Hi li,

    In this case, TIDL node will get the full object array and each instance of TIDL node can decide, which instance of the object array to be processed. There is no change required in the application. 

    preproc node can output object array to the TIDL node, TIDL node is not replicated and you could create two instance of the TIDL node with different parameters, then select the image from the input image object array to process in the TIDL node.. 

    A similar mechanism is used in the display node. Display node is not replicated and display node can get object array as input.. Then using control command TIVX_DISPLAY_SELECT_CHANNEL, application can configure display node to use one of the image from the input object array.

    You would need to change TIDL node to have control command to select the input channel, and then using tivxGetObjDescElement API, you could get the image for the active channel from the input object array.

     

    You could refer to the sample implementation in ti-processor-sdk-rtos-j721e-evm-08_01_00_13\tiovx\kernels_j7\hwa\display\vx_display_target.c file, especially below code in tivxDisplayProcess API and also tivxDisplaySwitchChannel API, which processes the control command..

    if((vx_status)VX_SUCCESS == status)
    {
        uint32_t active_channel;

        active_channel = displayParams->active_channel;

        obj_desc_image = (tivx_obj_desc_image_t *)   
            tivxGetObjDescElement(obj_desc[TIVX_KERNEL_DISPLAY_INPUT_IMAGE_IDX],
            active_channel);

        if (obj_desc_image == NULL)
        {
            status = (vx_status)VX_FAILURE;
        }
    }

    Regards,

    Brijesh