2

I'm working with image processing which means I'm doing operations on large matrices. I'm trying to debug which means I need to explore the elements, but it's a real pain doing it with print statements. Is there some kind of python plugin that will let me view arrays in a GUI for the purpose of debugging?

2
  • 1
    If you are doing image processing, why are you not showing the images, instead? Commented May 28, 2014 at 16:25
  • A number of the operations I do produce matrices of complex numbers or negative numbers - which aren't easily visualisable. I need access to the raw numbers themselves to check they make sense vs calculations by hand. Commented May 28, 2014 at 16:33

2 Answers 2

1

yes just use the python debugger and put a break point

or use something like q

$ easy_install q

import q
my_array = numpy.arange(1000)
q.d() #open a terminal where you have access to my_array

you will see something like below

Python console opened by q.d() in <some_module>
>>> print my_array[5]

you can also use pill to generate an image from the array (not sure if it will work right without tweaking)

>>> import Image
>>> img = Image.fromarray(my_array, 'RGB')
>>> img.save('test.png')
Sign up to request clarification or add additional context in comments.

1 Comment

q.d() was just the ticket! Thanks!
0

However, if you would like to display numpy array as an image, you can use OpenCV Image Viewer Plugin, which I've just released.

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

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.