Skip to content
  • 0 Votes
    2 Posts
    383 Views
    jsulmJ

    @Sai-Raul Start here: https://doc.qt.io/qt-5/videooverview.html

  • 0 Votes
    4 Posts
    1k Views
    A

    @jsulm Hello! Sorry, but that doesn't work. I tried to insert a loop in different places, but the result remains the same. I also tried to display the main widget.
    Снимок экрана от 2019-11-27 08-27-43.png

    @SGaist Hello. So the VideoWindow.h file (VideoWindow class) is my custom widget. This is the first piece of code that I presented.

  • 0 Votes
    22 Posts
    6k Views
    R

    @JKSH This is how I emit the OpenCV mat data:

    emit processedImage(2, videoFrameOut.ptr(0,0),videoFrameOut.cols, videoFrameOut.rows, videoFrameOut.step);

    The first parameter is just used to determine which display should draw the image and the rest are dimensions and stride which I think are ok.

    @SGaist You are correct, I changed the line below to make a copy:

    displayImage = QImage(imageData, width, height, step, QImage::Format_RGBA8888).copy(0,0,width,height);

    I think this fixed the issue. I got a couple of crashes in 'memcpy' but that was when loading files a little too quickly. I think most likey resizing the data quickly was the issue. I will do more testing this week and post the results.

    UPDATE: I did a lot more testing and making a local copy fixed the issue. The issue was that I was modifying the array before it was fully copied and this caused crashes when the array was downsized. I will need to revise the overall structure to make sure everything is done sequentially.

    Thanks!