I just started experimenting with Python and image processing. I followed this very well structured tutorial: http://pythonvision.org/basic-tutorial/ . Everything in the tutorial seems to work, with the image provided (the one with the cells). Now I wanted to try how this behaves when inputting another image. So I took another image (the one at the bottom of this post) and suddenly stuff is behaving differently. First off, pylab.show()
doesn't show the image heatmap but the regular image, while it should give the heatmap when no colormap is defined.
As a cause of this everything is behaving differently and it only recognises one component (everything that is not white). What am I missing? Does the input image have to be black and white/ grayscale? Does .jpg and .jpeg matter?
I can't seem to find the problem, help would be appreciated.
This code should give the default heatmap view but gives the regular image instead:
dna = mahotas.imread('tools.jpg')
dna = dna.squeeze()
pylab.imshow(dna)
pylab.show()
The image I'm trying to use: