<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: i.mx8mm opencv gpu acceleration in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/i-mx8mm-opencv-gpu-acceleration/m-p/1427696#M188178</link>
    <description>&lt;P&gt;This does not help. In the following link an NXP employee has told that "&lt;SPAN&gt;You can try to use gstreamer, we don't import hardware acceleration in opencv ". Is it true?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/i-MX-8-opencv-videocapture-very-slow-video-file/td-p/1258675" target="_blank"&gt;https://community.nxp.com/t5/i-MX-Processors/i-MX-8-opencv-videocapture-very-slow-video-file/td-p/1258675&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Mar 2022 11:00:44 GMT</pubDate>
    <dc:creator>erhany</dc:creator>
    <dc:date>2022-03-14T11:00:44Z</dc:date>
    <item>
      <title>i.mx8mm opencv gpu acceleration</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-mx8mm-opencv-gpu-acceleration/m-p/1424325#M187924</link>
      <description>&lt;P&gt;We are using NXP official BSP 5.4.47_2.0.0 where we have gstreamer and opencv 4. We are using xwayland distribution with weston. Writing the app with QT.&lt;/P&gt;&lt;P&gt;We have an RTSP stream where we want to show it on screen after applying some modifications.&lt;/P&gt;&lt;P&gt;If we play the stream with gst-launch everything runs smoothly. But when we want to use opencv (with gstreamer enabled) we cannot show the video smoothly on screen.&lt;/P&gt;&lt;P&gt;When using gstlaunch with: "&lt;SPAN&gt;rtspsrc latency=0 location=rtsp://192.168.1.3:8554/sample caps=&lt;/SPAN&gt;&lt;SPAN class=""&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;application/x-rtp&lt;/SPAN&gt;&lt;SPAN class=""&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt; ! rtph264depay! h264parse ! queue ! vpudec ! videoconvert ! waylandsink sync=false" everything is fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;In opencv we use the same pipeline like below:&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;rtspsrc buffer-mode=0 do-retransmission=false latency=0 location=rtsp://192.168.1.3:8554/sample caps=&lt;/SPAN&gt;&lt;SPAN class=""&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;application/x-rtp&lt;/SPAN&gt;&lt;SPAN class=""&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt; ! rtph264depay! h264parse ! queue ! vpudec ! videoconvert ! appsink sync=false"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But in this case we can only process 2-3 frames per second even we only capture the mat and send to a QOpenGLWidget. Nothing changes event we don't show anything on screen. The cpu usage is high so probably gpu acceleration is not active.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gstreamer is active in opencv. We also tried to compile opencv with WITH_OPENGL=on parameter but nothing has changed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the best way to use opencv in i.mx8mm? Here is a small code snippet showing what we have done:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;cv::VideoCapture cam1{};

cam1.open(STREAM1,cv::CAP_GSTREAMER)

if(cap-&amp;gt;read(frame) &amp;amp;&amp;amp; !frame.empty()){

    ui-&amp;gt;glWidget-&amp;gt;setQImage(QImage(frame.data, frame.cols, frame.rows, frame.step, QImage::Format_RGB888));

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample source can be found in&amp;nbsp;&lt;A href="https://tinyurl.com/2p8wacy6" target="_blank" rel="noopener"&gt;https://tinyurl.com/2p8wacy6&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 06:24:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-mx8mm-opencv-gpu-acceleration/m-p/1424325#M187924</guid>
      <dc:creator>erhany</dc:creator>
      <dc:date>2022-03-08T06:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: i.mx8mm opencv gpu acceleration</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-mx8mm-opencv-gpu-acceleration/m-p/1425714#M188031</link>
      <description>&lt;P&gt;Do you try&amp;nbsp;producer and consumer model in your code? This can improve fps issue.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 02:05:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-mx8mm-opencv-gpu-acceleration/m-p/1425714#M188031</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2022-03-10T02:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: i.mx8mm opencv gpu acceleration</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-mx8mm-opencv-gpu-acceleration/m-p/1427696#M188178</link>
      <description>&lt;P&gt;This does not help. In the following link an NXP employee has told that "&lt;SPAN&gt;You can try to use gstreamer, we don't import hardware acceleration in opencv ". Is it true?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/i-MX-8-opencv-videocapture-very-slow-video-file/td-p/1258675" target="_blank"&gt;https://community.nxp.com/t5/i-MX-Processors/i-MX-8-opencv-videocapture-very-slow-video-file/td-p/1258675&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 11:00:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-mx8mm-opencv-gpu-acceleration/m-p/1427696#M188178</guid>
      <dc:creator>erhany</dc:creator>
      <dc:date>2022-03-14T11:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: i.mx8mm opencv gpu acceleration</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-mx8mm-opencv-gpu-acceleration/m-p/1830275#M221414</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/151788"&gt;@Zhiming_Liu&lt;/a&gt;, any updates on how to use OpenCV on the GPU? (For this use case or another like using the&amp;nbsp;&lt;SPAN&gt;cv::BackgroundSubtractorMOG2 algorithm on the GPU)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 11:44:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-mx8mm-opencv-gpu-acceleration/m-p/1830275#M221414</guid>
      <dc:creator>mf_</dc:creator>
      <dc:date>2024-03-18T11:44:24Z</dc:date>
    </item>
  </channel>
</rss>

