Ask Your Question
0

Error with example from page 25

asked 2013-04-27 02:17:48 -0500

maketshi gravatar image

I'm trying to get this to work:

from SimpleCV import Display, Image
import time

display = Display()

Image("lenna2.png").save(display)

print "I lauched a window"

while not display.isDone():
    print "loop"
    time.sleep(0.1)

print "You closed the window"

But it is throwing this error When I [x] out of the window (I'm on Windows 7):

Traceback (most recent call last):
File "C:\Python27\ComputerVision\HelloBook5sec.py", line 10, in <module> while not display.isDone(): File "C:\Python27\lib\site-packages\SimpleCV\Display.py", line 650, in isDone self.checkEvents() File "C:\Python27\lib\site-packages\SimpleCV\Display.py", line 615, in checkEvents pressed = pg.key.get_pressed() error: video system not initialized

I tried it using

while display.isNotDone():

Instead, and got this error:

Traceback (most recent call last):
File "C:\Python27\ComputerVision\HelloBook5sec.py", line 10, in <module> while display.isNotDone(): File "C:\Python27\lib\site-packages\SimpleCV\Display.py", line 672, in isNotDone return not self.isDone() File "C:\Python27\lib\site-packages\SimpleCV\Display.py", line 650, in isDone self.checkEvents() File "C:\Python27\lib\site-packages\SimpleCV\Display.py", line 615, in checkEvents pressed = pg.key.get_pressed() error: video system not initialized

Googling the phrase "video system not initialized" seems to get mostly hits about PyGame. Could this be a problem with my installation? I installed Python 2.7 and Simple CV a few months ago, and seem to remember having some kind of trouble with paths, but I thought I worked it out.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2013-04-29 08:59:23 -0500

kscottz gravatar image

PyGame is a core dependency. Are you sure it is installed and configured correctly? A good quick check is to open a python shell and type "import pygame." If it is not installed I would go ahead and install it or re-install it. There could also be chance that it is not in your system path.

edit flag offensive delete link more

Comments

pygame seems to be installed. This is an older installation from January. I might should just re-install the latest version. I've also noticed that the plot function isn't working. I'm not sure if that's because of something omitted in the book, or if I just have a buggy install. Apparently, I don't has Matplotlib, which is not mentioned in the book.

maketshi gravatar imagemaketshi ( 2013-05-04 17:05:39 -0500 )edit

I am having the same problem with another example (feature detection). Did you ever resolve this problem?

tallboyy gravatar imagetallboyy ( 2013-08-07 01:07:20 -0500 )edit

having the same problem with the last few exercises from chapter 2 in the book... getting the same 'video system not initialized' error whenever the code is looking for a return value from the GUI window. Anyone know what the problem/solution is? pygame is installed on my machine.

memilanuk gravatar imagememilanuk ( 2014-05-08 00:09:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-04-27 02:17:48 -0500

Seen: 1,115 times

Last updated: Apr 29 '13