I am trying to make GUI for simpleCV program. I am using easyGUI to do that. Here is my code:
from easygui import *
from SimpleCV import *
from cv2 import *
from cv import *
from PIL import *
import time
import sys
while True:
msgbox("""Welcome to my program!""", image = "pi.jpg")
msgbox("Select img ")
nam=fileopenbox(filetypes=['*'])
print nam
img=Image(nam)
img1=img.binarize()
time.sleep(1)
img1.save("result.png")
msgbox("This is the result", image = "result.png")
msg = "Do you want to continue?"
title = "Please Confirm"
if ccbox(msg, title): # show continue/cancle dialog
print "okk" # user chose continue
else:
sys.exit(0) # user chose cancle
But I am getting weird error.. it says:
Traceback (most recent call last):
File "C:\Python27\tryyyy", line 13, in <module>
img=Image(nam)
TypeError: 'module' object is not callable
I tried print dir(Image), and I got:
['ADAPTIVE', 'AFFINE', 'ANTIALIAS', 'BICUBIC', 'BILINEAR', 'CONTAINER', 'CUBIC', 'DEBUG', 'EXTENSION', 'EXTENT', 'FLIP_LEFT_RIGHT', 'FLIP_TOP_BOTTOM', 'FLOYDSTEINBERG', 'ID', 'Image', 'ImageMode', 'ImagePalette', 'ImagePointHandler', 'ImageTransformHandler', 'IntType', 'LINEAR', 'MESH', 'MIME', 'MODES', 'NEAREST', 'NONE', 'NORMAL', 'OPEN', 'ORDERED', 'PERSPECTIVE', 'QUAD', 'RASTERIZE', 'ROTATE_180', 'ROTATE_270', 'ROTATE_90', 'SAVE', 'SEQUENCE', 'StringType', 'TupleType', 'UnicodeStringType', 'VERSION', 'WEB', '_E', '_ENDIAN', '_ImageCrop', '_MAPMODES', '_MODEINFO', '_MODE_CONV', 'builtins', 'doc', 'file', 'name', 'package', '_conv_type_shape', '_fromarray_typemap', '_getdecoder', '_getencoder', '_getscaleoffset', '_imaging_not_installed', '_initialized', '_show', '_showxv', '_wedge', 'blend', 'byteorder', 'composite', 'core', 'eval', 'fromarray', 'frombuffer', 'fromstring', 'getmodebandnames', 'getmodebands', 'getmodebase', 'getmodetype', 'init', 'isDirectory', 'isImageType', 'isNumberType', 'isSequenceType', 'isStringType', 'isTupleType', 'merge', 'new', 'open', 'os', 'preinit', 'register_extension', 'register_mime', 'register_open', 'register_save', 'string', 'sys', 'warnings']
I imported the SimpleCV; can you help me why I am getting this error, please? Thank you in advance.