PCV
PCV copied to clipboard
imtools.py gives error
By typing the below mentioned commands on command prompt by going into the folder of pca images e.g., C:\Users\Dell\Desktop\pcv_data\data> and typing the python on that prompt:
from PIL import Image
from numpy import *
im = array(Image.open(’AquaTermi_lowcontrast.jpg’).convert(’L’))
im2,cdf = imtools.histeq(im)
I see the following errors:
Traceback (most recent call last): File "
", line 1, in NameError: name 'imtools' is not defined
I put the imtools.py file into the same folder in which I am calling 'AquaTermi_lowcontrast.jpg'.
Is there a way to deal with such error. I am following the book tutorial given in the "Programming Computer Vision with Python by Jan Erik Solem". The same problem with your tutorial has been posed on stackoverflow and mail.python.org but I tried to call it first using
from imtools import *
import runs successfully but when i parse ''imtools.histeq(im)'' it gives me the error which is already mentioned above. And I also want to know what is best way to put these module code into which folder from where we can easily call them when needed without giving any path again and again.
Thanks.
did you solve this problem? I meet this error as well.
https://github.com/jesolem/PCV/blob/master/pcv_book/imtools.py
add histeq function to imtools file