Closed Laodax closed 7 years ago
What about
cam = image.Camera{}
@Atcold
~$ qlua
> require 'camera'
> cam=image.Camera{}
Initializing device: /dev/video0
FPS wanted 1
Using 1 buffers
camera[0] started : 1
>
It became this, but webcam didn't work. Is that reasonable?
What about
require 'camera'
image.display(image.Camera{})
> require 'camera'
> image.display(image.Camera{})
Initializing device: /dev/video0
FPS wanted 1
Using 1 buffers
camera[0] started : 1
...me/lab513/torch/install/share/lua/5.1/image/init.lua:1438: attempt to index field '?' (a nil value)
stack traceback:
...me/lab513/torch/install/share/lua/5.1/image/init.lua:1438: in function 'toDisplayTensor'
...me/lab513/torch/install/share/lua/5.1/image/init.lua:1545: in function 'display'
[string "image.display(image.Camera{})"]:1: in main chunk
[C]: ?
>
I want to know what ""cam = image.Camera() -- create the camera grabber"" means? And when I do this step by step(below), what will happen?
cam = image.Camera() -- create the camera grabber frame = cam:forward() -- return the next frame available cam:stop() -- release the camera image.display(frame) -- display frame
Thanks a lot!
My bad.
require 'camera'
cam = image.Camera{}
image.display(cam:forward())
That got worked! It can grab the first frame from the camera. Is that right?
Yeah, just keep :forward()
-ing for more frames.
You can close the issue now.
my step is below:
I can grab frames from my camera for about 10secs. But when I use "cam=image.Camera()", I got some error. Did someone get the same error? Thanks.
@clementfarabet Would you please hlep me? Thank you very much.