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: command to save raw image in cv::Mat format

Part Number: SK-TDA4VM

Hi,

gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-bayer, width=640, height=480, framerate=30/1, format=rggb ! tiovxisp sink_0::device=/dev/v4l-subdev2 sensor-name="SENSOR_SONY_IMX219_RPI" dcc-isp-file=/opt/imaging/imx219/dcc_viss_640x480.bin sink_0::dcc-2a-file=/opt/imaging/imx219/dcc_2a_640x480.bin format-msb=7 ! tiovxmultiscaler ! video/x-raw, format=NV12, width=640, height=480, framerate=30/1 ! kmssink driver-name=tidss sync=false

similar to above command, please tell me a command which will just capture raw frame and save it into a cv::Mat format without using any bin file.

Thanks.

  • Hi Tarun,

    OpenCV mat format conversion is not supported with GStreamer. You will need to write an application that takes in the raw image, converts it to OpenCV mat and saves it. We currently do not have any examples in our SDK documentation this accomplishes this, but there are plenty of tutorials outside of TI such as OpenCV's tutorials and forums that would serve as good resources.

    Thank you,

    Fabiana

  • Hi Fabiana,

    Can you just tell me how to capture raw image using command.

    Thankyou,

    Tarun

  • Hi Tarun,

    Try running a command similar to this:

    v4l2-ctl --verbose -d /dev/video2 --set-fmt-video=width=1920,height=1080,pixelformat=RGGB --stream-mmap

    Thanks,

    Fabiana

  • Hi Fabiana,

    I tried running the command but it didn't work. Please see below.

    root@tda4vm-sk:~/camera_sankalp# gst-launch-1.0 v4l2-ctl --verbose -d /dev/video2 --set-fmt-video=width=1920,height=1080,pixelformat=RGGB --stream-mmap
    Error initializing: Unknown option -d
    root@tda4vm-sk:~/camera_sankalp# gst-launch-1.0 v4l2-ctl --verbose device /dev/video2 --set-fmt-video=width=1920,height=1080,pixelformat=RGGB --stream-mmap
    Error initializing: Unknown option --set-fmt-video=width=1920,height=1080,pixelformat=RGGB
    root@tda4vm-sk:~/camera_sankalp#
    root@tda4vm-sk:~/camera_sankalp# gst-launch-1.0 v4l2-ctl --verbose device /dev/video2 video=width=1920,height=1080,pixelformat=RGGB --stream-mmap
    Error initializing: Unknown option --stream-mmap
    root@tda4vm-sk:~/camera_sankalp# gst-launch-1.0 v4l2-ctl --verbose device /dev/video2 video=width=1920,height=1080,pixelformat=RGGB              

    (gst-launch-1.0:1914): GStreamer-CRITICAL **: 13:37:05.959: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
    ERROR: pipeline could not be constructed: no element "v4l2-ctl".

    Regards,

    Tarun

  • Hi Tarun,

    Please try running without "gst-launch-1.0".

    Thank you,

    Fabiana

  • Thanks for the help Fabiana.

    Also please tell if by some similar command I can get raw colored image. Above command is giving gray scale image.

  • Hi Tarun,

    Please note that the EdgeAI documentaiton provided detailed explaination on all the supported GStreamer use-cases. It does not mean that it covers all the possible use-cases. We except customer to get trained on GStreamer using online resources availble.

    Also, you are free to explore the source code included/provided in the SDK for your analysis and modification. TI does not provided customization support and the onus is at your end.

    The queries you are asking above is outside the standard support that we provide to our customer. Hope this clarifies.

    Thanks.

  • Hello Fabiana,

    How can i capture raw image at a resolution of 800x1200 , width =800 and height =1200. 

    Thankou .

    Tarun

  • Hi Tarun,

    You could run a command similar to what I previously suggested and make the change needed to meet your desired resolution. What commands have you tried running to capture raw image at 800x1200 resolution?

    I suggest looking into V4L2 utilities such as v4l2-ctl and media-ctl as well as GStreamer tutorials to aid you in your work.

    Thank you,

    Fabiana