I am following https://www.analyticsvidhya.com/blog/2014/12/image-processing-python-basics/ to practice image processing.
I am writing the code in an incremental way and checking if everything goes well. So far I have written the following code
from matplotlib import pyplot as plt
from skimage import data
from skimage.feature import blob_dog, blob_log, blob_doh
from math import sqrt
from skimage.color import rgb2gray
import glob
from skimage.io import imread
example_file=glob.glob(r"/home/snowbell/sample.jpg")[0]
im=imread(example_file, as_grey=True)
plt.imshow(im, cmap=cm.gray)
plt.show()
The image location and the image name is only thing I have changed. I am getting the following error:-
Traceback (most recent call last):
File "test.py", line 11, in <module>
plt.imshow(im, cmap=cm.gray)
NameError: name 'cm' is not defined
cm.gray
to produce? You never defined the namecm
nor did you import it.