How do I view numbers in a cv::mat when debugging in visual studio

asked 2018-08-06 08:56:58 -0500

I would like to be able to see the numbers inside a cv::mat when using that matrix for image transformations, for example the camera and perspective transformation matrices that come out of the StereoCalibrate function. These are 34 or 33 size matrices and seeing the raw numbers is essential.

I would like something equivalent to "Image Watch 2017" which shows you the image represented by a cv::mat, but instead I just want to see the actual raw values. For other libraries, such as glm, the matrices are stored as arrays of arrays so I can actually go in the debugger and see the raw values, is there a plugin or something equivalent that allows me to do this when doing Visual Studio debugging using C++?

edit retag flag offensive close merge delete

Comments

1

What*s wrong with Image Watch 2017? To watch raw values you just have to zoom in enough. An alternative way would be to assign cv::Mat to std::vector to get raw values.

matman gravatar imagematman ( 2018-08-06 09:09:28 -0500 )edit

Wow, I didn't know that! That is so useful. Thank you.

Dominic Hosler gravatar imageDominic Hosler ( 2018-08-06 15:20:37 -0500 )edit

i don't have VS any more, but i remember, that you could type something like:

(float*)(m.data), 12

in the debuggers expression window.

berak gravatar imageberak ( 2018-08-09 03:16:33 -0500 )edit