We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello!
This code is running ok, except the video (webcam capture) is only returning a black frame - I can see the webcam light is on whilst running this code. I couldn't find a working example in the Python examples or the openCV python examples either. Any help is much appreciated!
add_library('video')
from random import randint
def setup():
global video
size(1280, 720, P3D)
video = Capture(this, 640, 480)
video.start()
def draw():
print randint(0,9)
image(video, 0, 0)
Answers
http://forum.processing.org/two/discussion/10541/problems-with-video
Thank you very much GoToLoop, that worked! Calling video.read() before image(video, 0, 0) solved it.
I'll be sure to deconstruct and understand java examples in future! Thank you once again, it's really appreciated.