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.

TDA4VM: Is it possible to access VISS output image memory without OpenVX node?

Part Number: TDA4VM

Tool/software:

Hi TI experts,

We have original parking slot detection algorithm with CPU computation.
I understand that we need to create a custom OpenVX node to port that algorithm to the j721 board, but this is a bit complicated.

Originally we created 4 threads equal to the number of cameras, each thread accesses the memory of the camera image and detects the parking slots. The easiest way for us is to access the 4 camera image memories (as host memory).

You might recommend OpenVX, but we are asking this question because we don't have much time to spend on development.

I have applied the patch I got in this thread.
TDA4VM: Improving the processing speed of custom avp4 demo - Processors forum - Processors - TI E2E support forums

Is it possible to access the image memory directly from the dequeued VISS output graph parameters?

Regards,

Daigo

  • Hi Daigo,

    Yes it is possible to get the image memory form the vx_image object.

    When you make viss output as graph parameter you enqueue/dequeue a reference of type vx_image that points to the channel 0 of object_array. From that you can get its parent object which is an object_array, then you can get all the channels output.

        status = vxGraphParameterDequeueDoneRef(obj->graph, obj->viss_output_graph_parameter_index, (vx_reference*)&viss_output, 1, &num_refs);
    
        vx_image viss_image[4];
    
        vx_object_array parent_obj_arr = vxCastRefAsObjectArray( tivxGetReferenceParent(vxCastRefFromImage(viss_output)), &status );
        
        viss_image[0] = (vx_image)vxGetObjectArrayItem(parent_obj_arr, 0); // channel 0
        viss_image[1] = (vx_image)vxGetObjectArrayItem(parent_obj_arr, 1); // channel 1
        viss_image[2] = (vx_image)vxGetObjectArrayItem(parent_obj_arr, 2); // channel 2
        viss_image[3] = (vx_image)vxGetObjectArrayItem(parent_obj_arr, 3); // channel 3
    

    You can use vxMapImagePatch() api to get the memory pointer for the image data, and you can process it in your application.

    Regards,
    Gokul

  • Hi Gokul,

    Thank you, this is exactly what I want to do. I did not know this function existed.

    Now that I know I can use this func to do image processing on the CPU, there is one thing I think I should be aware of: When next frame will be written to this memory after we have informed the thread of our own detection of the memory address. Could you advise how this should be managed?

    Regards,

    Daigo

  • Hi Gokul,

    I actually tried this memory access method and printed a log after the map.

    The log prints system time in ms, frame ID, and memory address after mapping.

    Then I noticed something strange. Sometimes the time until the next frame ID is very short. Why is this? If the camera is at 30fps, there should be an interval of about 34ms.

    [timestamp] [id]              memory address
    [175880] [10] viss_image[0] = 0x9B71F000
    [175985] [11] viss_image[0] = 0xA4012000
    [175986] [12] viss_image[0] = 0x9AAF7000
    [176019] [13] viss_image[0] = 0x99ECF000
    [176049] [14] viss_image[0] = 0x9B71F000
    [176084] [15] viss_image[0] = 0xA4012000
    [176128] [16] viss_image[0] = 0x99ECF000
    [176165] [17] viss_image[0] = 0x9AAF7000
    [176199] [18] viss_image[0] = 0x9B71F000
    [176236] [19] viss_image[0] = 0xA4012000
    [176298] [20] viss_image[0] = 0x99ECF000
    [176298] [21] viss_image[0] = 0x9AAF7000
    [176330] [22] viss_image[0] = 0x9B71F000

    Regards,

    Daigo

  • Hi Daigo,

    Can you please raise another thread for this mentioning the graph details (nodes connected in the graph).

    Regards,
    Gokul

  • Thanks Daigo, closing this thread.

    Regards,
    Gokul