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: Multi-cam Save image

Part Number: TDA4VM

Hi TI experts,

My software version is:
  PDK-RTOS :processor-sdk-rtos-j721e-evm-08_06_00_12
  PDK-LINUX:processor-sdk-linux-08_06_00

We have connected 2 cameras to CSI1. When run_app_multi_cam.sh is running, we want to press 'S' and save the capture image locally.

How to enable the save image function in the app_multi_cam demo we are currently using?

How do we need to modify the code?

Looking forward for your reply, thank you

Regards,

Barry

  • Hello,

    This thread is assigned to our engineer in the India office. Due to a regional holiday, half of our team is out of the office. Please expect a 1~2 day delay in responses.

    Apologies for the delay, and thank you for your patience.

    Thanks.

  • Hi Barry,

    In order to save an image by press "s" in multi-cam demo, all you need is to enable the flag "en_out_capture_write" in app_multi_cam.cfg present in vision_apps/apps/basic_demos/app_linux_fs_files/vision_apps_evm/

    also, please note that you would have to create app_cam_out folder in /opt/vision_apps/ on the SD Card for the images to save.

    After this, when you run the application and press "s", you'll save the images.

    Regards,

    Nikhil

  • Hi Nikhil,

    Thank you for your attentive reply.

    Writing /opt/vision_apps/app_cam_out/csix_raw_output_1920x1536_ch_0_00000512.bin ..
    Done!
    Writing /opt/vision_apps/app_cam_out/csix_raw_output_1920x1536_ch_1_00000512.bin ..
    Done!

    We have saved the bin file.What tool or command should we use to view this file normally?

    Looking forward for your reply, thank you

    Regards,

    Barry

  • Hi,

    I typically use tools such as IrfanView.

    You could also use any other tools that support viewing of Raw images with the help of their inbuilt basic ISP.

    Regards

    Nikhil

  • Hi Nikhil,

    Thank you for your attentive reply.

    We connected 2 cameras on CSI1, the resolution is 1920x1536.

    The attachment is the output after we press S. When we set the resolution to 1920x1536, we found that it cannot be viewed.

    But at 1920x700, the image looks OK, but it looks like 2 pictures side by side.

    log:

    Writing /opt/vision_apps/app_cam_out/csix_raw_output_1920x1536_ch_0_00000311.bin ..
    Done!
    Writing /opt/vision_apps/app_cam_out/csix_raw_output_1920x1536_ch_1_00000311.bin ..
    Done!

    1920x1536_ch0.zip

    Can you help explain:

    How many images will be saved on each channel when pressing 'S' in MultiCam?

    What's the reason for the side-by-side phenomenon I'm seeing now?

    Your reply is very important to us, we look forward to your quick reply, thank you

    Regards,

    Barry

  • Hi Barry,

    How many images will be saved on each channel when pressing 'S' in MultiCam?

    This depends on the value of "num_frames_to_write" in the cfg file. By default it is 1. So when you press "S", you would get 1 frame from each camera.

    What's the reason for the side-by-side phenomenon I'm seeing now?

    The file you had sent me is a .bin file. 

    whereas if your sensor is giving a raw bayer output, it should have been saved as .raw file.

    Could you please confirm if you are stream YUV422 or raw from the sensor? (i.e. what is the value of sensor_out_format in the application)

    Regards,

    Nikhil

  • Hi Nikhil,

    Thanks for reply.

    We connected 2 cameras on CSI1, the resolution is 1920x1536.

    The sensor output format is: 1920x1536 VX_DF_IMAGE_UYVY, so the format under save is bin.

    As shown in my attachment above, opening the saved bin file shows two images from the same camera channel side_by_side.

    What is the reason why two images are displayed side by side?

    What should be the resolution of the saved image?

    Looking forward to the expert's reply.

    Regards,

    Barry

  • Hi,

    What is certain is:

    # Number of frames to write per 's' command,

    num_frames_to_write 1

    Why does each channel data we save always seem to have two images? What is the reason?

    What should we do to save only one 1920x1536 image per channel?

    Looking forward to the experts’ help, thank you

    Regards,

    Barry

  • Hi Barry,

    Are you seeing the correct output on the display?

    Could you connect the output of capture node to display node and check if you are seeing the same on display?

    Also, are you seeing the same issue with only 1 cam connected?

    Regards,

    Nikhil

  • Hi Nikhil,

    Can you directly explain why save image behaves like this?

    I’ll send you the attachment again:

    5531.1920x1536_ch0.zip

    # Number of frames to write per 's' command,

    num_frames_to_write 1

    Why does each channel data we save always seem to have two images? What is the reason?

    What should we do to save only one 1920x1536 image per channel?

    Looking forward to the experts’ help, thanks

    Regards,

    Barry

  • Hi Barry,

    This is SDK 8.6 right? I think this could be related to a known issue back then.

    Could you please apply the below patch in PDK repo of SDK and rebuild the csirx driver?

    /cfs-file/__key/communityserver-discussions-components-files/791/2311.YUV422_5F00_fix.patch

    Please rebuild the pdk_libs using the below command

    cd ${PDK_PATH}/packages/ti/build/
    make pdk_libs CORE=mcu2_0 -sj

    Please make sure that the csirx file is built here. After this rebuild the application and check if you are facing this issue.

    Regards,

    Nikhil

  • Hi Nikhil,

    We fixed the known issue of dataSizeShift on SDK8.6 very early.

    For the SAVE bin, we can see the image.

    Our question is:

    Looking forward to the experts’ help, thanks

    Regards,

    Barry

  • Hi Barry,

    I think the issue is in the write node here.

    Seeing the target implementation of the write node, it seems that it write parameters are for NV12 and not for YUV422.

    In the file vision_apps/kernels/fileio/arm/vx_fileio_write_image_target.c, you could see the below in tivxKernelWriteImageProcess() function

    It should be 2*width (and not just width) for YUV422 in the fwrite() API.

    Could you try the same and let me know if you are facing this issue?

    Regards,

    Nikhil

  • Thanks Nikhil, close this ticket