Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    OpenCV Mat debugging helper

    Tools
    debug opencv qtcreator
    4
    5
    5561
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dfarm last edited by

      Hello, I did some searching on the forum and couldn't find a solution for this. I'm trying to figure out how to setup qt-creator to be able to visualize cv::Mat structures from OpenCV. I looked at the source for the qttypes.py debugger helper and I saw one for QImage that looked promising. Before I tried to cargo cult that thing though I thought I would ask here if anyone has already done this (yet managed to evade Google) or has some tips. If it's helpful here is a nice SO question on converting between Mat & QImage. https://stackoverflow.com/questions/5026965/how-to-convert-an-opencv-cvmat-to-qimage -- actually even a link to better documentation for debugging helpers would be great. As far as I can tell there is one page of very high level description on Qt's site and 2 blog posts about it. As an example something I saw in the source but can't find any trace of anywhere is there seems to be facilities for using gnuplot (putPlotData in debugger)

      Oh as one more avenue, I did find a few gdb python visualizers for cv::Mat but every one of them deadlocked GDB when I tried it (they called out to Python's matplotlib).

      Thanks for any pointers!

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        Is this page what you found and read on the matter ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        D 1 Reply Last reply Reply Quote 0
        • D
          dfarm @SGaist last edited by dfarm

          @SGaist Yes, it's pretty sparse. In particular it doesn't address the image case at all.

          [EDIT: I complained about not being able to get even QImage helper to work, but resolved this by installing the qt4 libraries with debug info]

          Further googling led me to this post: http://forum.qt.io/topic/47370/debug-helper-for-visualizing-images but this person also failed. It seems like it should be possible it's just that nobody who has attempted has understood how debugging helpers work (myself included).

          D 1 Reply Last reply Reply Quote 0
          • D
            DMoodie @dfarm last edited by DMoodie

            Hi,

            So the issue with the debug visualizer that I was working on was the fact that QT never recognized the "Displayed" flag. :/
            If we can figure out why QT never even recognizes the flag then I can probably finish that visualizer.

            For now this is my solution:
            http://dtmoodie.blogspot.com/2015/02/getting-image-watch-like-debugging-in.html

            1 Reply Last reply Reply Quote 0
            • Y
              Yanming last edited by

              Hi,

              If my cv::Mat variable is a 2 dimension matrix of a small size (<10*10), is it possible to show its elements in "locals and expressions" window? Is it easy or lots of work needed? Or there has already been some tools?

              Thanks a lot.
              Yanming

              1 Reply Last reply Reply Quote 0
              • First post
                Last post