File: SimpleCv.py

package info (click to toggle)
python-easygui 0.98.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,492 kB
  • sloc: python: 3,242; makefile: 151; xml: 120
file content (39 lines) | stat: -rw-r--r-- 1,044 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
__author__ = 'Future Engineer'

"""
from:
http://stackoverflow.com/questions/27873818/easygui-and-simplecv-typeerror-module-object-is-not-callable

Note: this module has a lot of dependencies: SimpleCV, OpenCV, PIL
"""
import sys

sys.path.append('..')
import code
import easygui as eg
from easygui import *
from SimpleCV import *
from cv2 import *
from cv import *
from PIL import *
import time
import sys

# Set a breakpoint
code.interact("Code paused.  Hit ctrl-D when ready to continue", local=dict(globals(), **locals()))
while True:
    eg.msgbox("""Welcome to my program!""", image = "pi.jpg")
    msgbox("Select img ")
    nam=fileopenbox(filetypes=['*'])
    print(nam)
    img=Image.open(nam)
    img1=img.convert('1')
    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