androidopencvimage-processingmat

View Mat content while debugging


I'm coding some image processing algorithms using Android OpenCV and I'm going crazy to debug some parts. Say that my steps are:

  1. threshold source image (Mat src) so I get a Mat with the result (Mat dst)
  2. get objects (Mat objs)
  3. get contours (Mat conts)
  4. etc.

Is there any way to check the contents of each Mat in debug mode? (apart from "plotting" the image in my device). It would be awesome to see the whole matrix in a table (like in Matlab workspace). Thanks!


Solution

  • Yes! You can use OpenCV Image Viewer Plugin, which works with Android Studio. It displays the Mat in IDE with one click while debugging. No need to plot in the device :)

    https://plugins.jetbrains.com/plugin/14371-opencv-image-viewer enter image description here

    Disclaimer: I'm the author of this plugin