How to turn off the Camera in SimpleCV using python -


i getting following error when run code below:

error: camera instance has no attribute 'release'

from simplecv import * import time def camera(self):     try:         cam=camera(0)                 while cam not none:                     try:                         img = cam.getimage()                         img.show()                         time.sleep(0.1)                     except exception e:                         print(e)     except exception e:         print(e)     finally:         cam.release()         del cam 

any suggestions how correct it?

first of all, looking @ documentation/source, doesn't release() attribute (i.e. method) inside class camera of simplecv, (as error suggests,) you're trying call doesn't exist. guess omit line cam.release() since del cam calls destructor __del__ closes camera you.

please correct me if i'm wrong. documentation: https://github.com/sightmachine/simplecv/blob/master/simplecv/camera.py

so just:

finally:     del cam 

ps: have posted comment i'm new user no rep :)


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -