Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
OpenCV Mat debugging helper
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!
Hi and welcome to devnet,
Is this page what you found and read on the matter ?
dfarm 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).
DMoodie last edited by DMoodie
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:
Yanming last edited by
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.