Code Monkey home page Code Monkey logo

lua---camera's Introduction

DEPENDENCIES:
MacOS: Install OpenCV 2.X: http://opencv.willowgarage.com/
Linux: None

All: Torch7 (follow instructions here: www.torch.ch)

INSTALL:
$ luarocks install camera

STATE:
MacOS: working on all MacOS builds, using OpenCV (wrapper from Jordan Bates)
Linux: working all right, using raw video4linux2 (wrapper from Clement Farabet)

USE:
$ torch
> require 'camera'
> camera.testme()   -- a simple grabber+display
> 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

lua---camera's People

Contributors

arnaudchauveur avatar atcold avatar bmartini avatar clementfarabet avatar jhjin avatar jtbates avatar marcoscoffier avatar soumith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lua---camera's Issues

QTKit not available anymore on macOS Sierra

This package does not compile anymore on Sierra as Apple has removed QTKit (see this issue from OpenCV for more info). OpenCV solved this by porting their code to use AVFoundation instead, but I have no experience with this so I'm just reporting this without a PR (sorry!).

Failed building

I try to do luarocks install camera in mac os, I get this error in 75%:

Scanning dependencies of target camopencv
[ 25%] Building C object opencv/CMakeFiles/camopencv.dir/opencv.c.o
[ 50%] Linking CXX shared module libcamopencv.so
[ 50%] Built target camopencv
Scanning dependencies of target cammacos
[ 75%] Building C object macos/CMakeFiles/cammacos.dir/camera.m.o
In file included from /tmp/luarocks_camera-1.1-0-3034/lua---camera/macos/camera.m:25:
/tmp/luarocks_camera-1.1-0-3034/lua---camera/macos/camera.h:6:9: fatal error:
'QTKit/QTKit.h' file not found
#import <QTKit/QTKit.h>
^
1 error generated.
make[2]: *** [macos/CMakeFiles/cammacos.dir/camera.m.o] Error 1
make[1]: *** [macos/CMakeFiles/cammacos.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed building.]

I have opencv 2.4.13.1 installed.
Do someone know how to solve this problem?
Thank you.
Pierre

When use "cam=image.Camera()", I get some error.

my step is below:

$ qula
> require 'camera' 
> camera.testme()
-------------------------------------------------
grabbing frames from your camera for about 10secs
Initializing device: /dev/video0
FPS wanted 1 
Using 1 buffers
camera[0] started : 1
stopping camera
done: create your own frame grabber with image.Camera()
--------------------------------------------------
> cam=image.Camera()
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ImageSource

> usage:
ImageSource{
    [idx = number]                      -- camera index  [default = 0]
    [width = number]                    -- width  [default = 640]
    [height = number]                   -- height  [default = 480]
    [buffers = number]                  -- number of buffers (v4l2 only)  [default = 1]
    [fps = number]                      -- optional frame rate (v4l2 only)  [default = 1]
}

ImageSource{width=number, idx=number}
ImageSource(number, ...)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...ome/lab513/torch/install/share/lua/5.1/xlua/init.lua:321: error
stack traceback:
	[C]: in function 'error'
	...ome/lab513/torch/install/share/lua/5.1/xlua/init.lua:321: in function 'error'
	...ome/lab513/torch/install/share/lua/5.1/xlua/init.lua:544: in function 'unpack'
	...home/lab513/torch/install/share/lua/5.1/v4l/init.lua:17: in function '__init'
	...me/lab513/torch/install/share/lua/5.1/torch/init.lua:91: in function <...me/lab513/torch/install/share/lua/5.1/torch/init.lua:87>
	[C]: in function 'Camera'
	[string "cam=image.Camera()"]:1: in main chunk
	[C]: ?

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.

did someone just break camera? I cannot install it again

[100%] Building CXX object macos/CMakeFiles/cammacos.dir/camera.m.o
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:120:0,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.h:5,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:25:
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:75:24: error: expected identifier or '(' before '^' token
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:78:1: error: expected identifier before 'end'
In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:9:0,
from /System/Library/Frameworks/AppKit.framework/Headers/NSView.h:8,
from /System/Library/Frameworks/AppKit.framework/Headers/NSText.h:8,
from /System/Library/Frameworks/AppKit.framework/Headers/NSCell.h:10,
from /System/Library/Frameworks/AppKit.framework/Headers/NSActionCell.h:8,
from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:15,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.h:5,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:25:
/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:403:178: error: expected ')' before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:403:180: error: expected ')' before '(' token
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:17:0,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.h:5,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:25:
/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:20:34: error: expected ')' before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:20:36: error: expected ')' before '(' token
/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:20:99: error: expected ')' before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:20:101: error: expected ')' before '(' token
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:54:0,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.h:5,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:25:
/System/Library/Frameworks/AppKit.framework/Headers/NSDraggingItem.h:52:15: error: expected identifier or '(' before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSDraggingItem.h:53:5: error: expected ';' before 'NSInteger'
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:73:0,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.h:5,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:25:
/System/Library/Frameworks/AppKit.framework/Headers/NSSpellChecker.h:168:247: error: expected ')' before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSSpellChecker.h:168:249: error: expected ')' before '(' token
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:194:0,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.h:5,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:25:
/System/Library/Frameworks/AppKit.framework/Headers/NSWindowRestoration.h:119:116: error: expected ')' before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSWindowRestoration.h:119:118: error: expected ')' before '(' token
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m: In function '-[ImageSnap snapshot]':
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:168:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:174:18: error: '-fobjc-exceptions' is required to enable Objective-C exception syntax
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m: In function '-[ImageSnap stopSession]':
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:201:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:205:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:207:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:209:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:212:7: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:215:7: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m: In function '-[ImageSnap startSession:withWidth:withHeight:]':
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:237:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:240:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:254:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:260:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:262:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:272:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:274:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:285:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:295:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:308:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:315:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:318:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m: In function '-[ImageSnap captureOutput:didOutputVideoFrame:withSampleBuffer:fromConnection:]':
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:331:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:333:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m: In function 'initCameras':
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:423:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:427:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m: In function 'grabFrames':
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:446:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:448:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m: In function 'luaopen_libcammacos':
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:506:3: warning: implicit declaration of function 'luaL_openlib' [-Wimplicit-function-declaration]
make[2]: *** [macos/CMakeFiles/cammacos.dir/camera.m.o] Error 1
make[1]: *** [macos/CMakeFiles/cammacos.dir/all] Error 2
make: *** [all] Error 2
[ 33%] Built documentation
[ 33%] Built target documentation-dok
[ 66%] Built target camopencv
[100%] Building CXX object macos/CMakeFiles/cammacos.dir/camera.m.o
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:120:0,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.h:5,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:25:
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:75:24: error: expected identifier or '(' before '^' token
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:78:1: error: expected identifier before 'end'
In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:9:0,
from /System/Library/Frameworks/AppKit.framework/Headers/NSView.h:8,
from /System/Library/Frameworks/AppKit.framework/Headers/NSText.h:8,
from /System/Library/Frameworks/AppKit.framework/Headers/NSCell.h:10,
from /System/Library/Frameworks/AppKit.framework/Headers/NSActionCell.h:8,
from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:15,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.h:5,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:25:
/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:403:178: error: expected ')' before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:403:180: error: expected ')' before '(' token
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:17:0,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.h:5,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:25:
/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:20:34: error: expected ')' before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:20:36: error: expected ')' before '(' token
/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:20:99: error: expected ')' before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:20:101: error: expected ')' before '(' token
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:54:0,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.h:5,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:25:
/System/Library/Frameworks/AppKit.framework/Headers/NSDraggingItem.h:52:15: error: expected identifier or '(' before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSDraggingItem.h:53:5: error: expected ';' before 'NSInteger'
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:73:0,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.h:5,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:25:
/System/Library/Frameworks/AppKit.framework/Headers/NSSpellChecker.h:168:247: error: expected ')' before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSSpellChecker.h:168:249: error: expected ')' before '(' token
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:194:0,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.h:5,
from /Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:25:
/System/Library/Frameworks/AppKit.framework/Headers/NSWindowRestoration.h:119:116: error: expected ')' before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSWindowRestoration.h:119:118: error: expected ')' before '(' token
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m: In function '-[ImageSnap snapshot]':
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:168:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:174:18: error: '-fobjc-exceptions' is required to enable Objective-C exception syntax
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m: In function '-[ImageSnap stopSession]':
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:201:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:205:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:207:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:209:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:212:7: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:215:7: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m: In function '-[ImageSnap startSession:withWidth:withHeight:]':
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:237:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:240:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:254:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:260:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:262:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:272:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:274:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:285:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:295:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:308:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:315:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:318:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m: In function '-[ImageSnap captureOutput:didOutputVideoFrame:withSampleBuffer:fromConnection:]':
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:331:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:333:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m: In function 'initCameras':
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:423:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:427:3: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m: In function 'grabFrames':
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:446:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:448:5: warning: value computed is not used [-Wunused-value]
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m: In function 'luaopen_libcammacos':
/Users/eugenioculurciello/.torch/torch-pkg/camera/macos/camera.m:506:3: warning: implicit declaration of function 'luaL_openlib' [-Wimplicit-function-declaration]
make[2]: *** [macos/CMakeFiles/cammacos.dir/camera.m.o] Error 1
make[1]: *** [macos/CMakeFiles/cammacos.dir/all] Error 2
make: *** [all] Error 2

Installation problem - cv.h: No such file or directory

I tried to install camera with luarocks install camera on ubuntu 15.10 but got the following error

karan@karan-ThinkPad-L412:~$ luarocks install camera
Installing https://raw.githubusercontent.com/torch/rocks/master/camera-1.1-0.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/camera-1.1-0.rockspec... switching to 'build' mode
Cloning into 'lua---camera'...
remote: Counting objects: 29, done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 29 (delta 3), reused 14 (delta 0), pack-reused 0
Receiving objects: 100% (29/29), 18.57 KiB | 0 bytes/s, done.
Resolving deltas: 100% (3/3), done.
Checking connectivity... done.
cmake -E make_directory build;
cd build;
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/home/karan/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/home/karan/torch/install/lib/luarocks/rocks/camera/1.1-0"; 
make

-- The C compiler identification is GNU 5.2.1
-- The CXX compiler identification is GNU 5.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Torch7 in /home/karan/torch/install
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp  
-- OpenMP Found with compiler flag : -fopenmp
CMake Warning at video4linux/CMakeLists.txt:13 (FIND_PACKAGE):
  By not providing "FindARM.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "ARM", but
  CMake did not find one.

  Could not find a package configuration file provided by "ARM" with any of
  the following names:

    ARMConfig.cmake
    arm-config.cmake

  Add the installation prefix of "ARM" to CMAKE_PREFIX_PATH or set "ARM_DIR"
  to a directory containing one of the above files.  If "ARM" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/luarocks_camera-1.1-0-1500/lua---camera/build
Scanning dependencies of target camopencv
[ 25%] Building C object opencv/CMakeFiles/camopencv.dir/opencv.c.o
/tmp/luarocks_camera-1.1-0-1500/lua---camera/opencv/opencv.c:29:16: fatal error: cv.h: No such file or directory
compilation terminated.
opencv/CMakeFiles/camopencv.dir/build.make:54: recipe for target 'opencv/CMakeFiles/camopencv.dir/opencv.c.o' failed
make[2]: *** [opencv/CMakeFiles/camopencv.dir/opencv.c.o] Error 1
CMakeFiles/Makefile2:77: recipe for target 'opencv/CMakeFiles/camopencv.dir/all' failed
make[1]: *** [opencv/CMakeFiles/camopencv.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2

Error: Build error: Failed building.

camera does not install on OS X 10.8 with gfortran

fixed with:
PROBLEM: Oct 2012: camera package does not install with compiler: /usr/local/gfortran/bin/gcc

Solution: remove links to gfortran:
export CC=
export CXX=

echo $CCX should return nothing
then you can install fine

Bug with dual camera device

I am trying to use lua---camera with a Minoru 3D webcam. On Linux (Ubuntu 12.04) no problem; on Mac I get

failed OpenCV test capture: Operation timed out

when I try to access to the second cam.

New tag is needed

What about releasing a new tag, since the recent bug fixes and enhancements?

Use (from the README)

Just typing what is written in the main README file gives me the following

t7> require 'camera'
t7> camera.testme()
--------------------------------------------------
grabbing frames from your camera for about 10secs
initializing camera
camera initialized
Cleaned up camera.
stopping camera 
done: create your own frame grabber with image.Camera() 
--------------------------------------------------
t7> cam = image.Camera()
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
image.Camera

> usage:
image.Camera{
    [idx = number]                      -- camera index  [default = 0]
    [width = number]                    -- frame width  [default = 640]
    [height = number]                   -- frame height  [default = 480]
}

image.Camera{width=number, idx=number}
image.Camera(number, ...)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++:
{}
/usr/local/share/lua/5.1/xlua/init.lua:311: error
stack traceback:
        [C]: in function 'error'
        /usr/local/share/lua/5.1/xlua/init.lua:311: in function 'error'
        /usr/local/share/lua/5.1/xlua/init.lua:519: in function 'unpack'
        /usr/local/share/lua/5.1/camopencv/init.lua:17: in function '__init'
        /usr/local/share/lua/5.1/torch/init.lua:45: in function </usr/local/share/lua/5.1/torch/init.lua:41>
        [C]: in function 'Camera'
        [string "cam = image.Camera()"]:1: in main chunk
        [C]: at 0x010fb43d80

The 10 seconds test does work (even if the aspect ration is wrong), the frame grabber doesn't

Lua 5.2 compatibility

I get the following error when running luarocks install camera:

[100%] Building C object video4linux/CMakeFiles/v4l.dir/v4l.c.o
/tmp/luarocks_camera-1.1-0-8939/lua---camera/video4linux/v4l.c:644:30: error: array type has incomplete element type
 static const struct luaL_reg v4l [] = {
                              ^
make[2]: *** [video4linux/CMakeFiles/v4l.dir/v4l.c.o] Error 1

With a quick look it seems that this problem is due to Lua 5.2 missing luaL_reg.

returns black image for me with new torch7

Torch 7.0 Copyright (C) 2001-2011 Idiap, NEC Labs, NYU
Lua 5.1 Copyright (C) 1994-2008 Lua.org, PUC-Rio
t7> require 'libcamopencv'
t7> =libcamopencv.initCam(0, 640, 480)
initializing camera
camera initialized
0
t7> ima = torch.Tensor()
t7> libcamopencv.grabFrame(0, ima)
CRASH!!!!!

Run problem:failed to load camopencv wrapper: verify that camopencv is installed

I was tring to run require 'camera' to test it, only to find camopencv has not been installed. Is there any problem of my operation or where should I get this package?
Here's the details:

th> require 'camera'
/Users/Meirtz/torch/install/share/lua/5.1/trepl/init.lua:384: ...s/Meirtz/torch/install/share/lua/5.1/luarocks/loader.lua:154: Invalid data in manifest file for module camopencv (invalid data for camera 1.1-0)   
warning: <camopencv> could not be loaded (is it installed?) 
/Users/Meirtz/torch/install/share/lua/5.1/trepl/init.lua:384: /Users/Meirtz/torch/install/share/lua/5.1/xlua/init.lua:321: failed to load camopencv wrapper: verify that camopencv is installed
stack traceback:
    [C]: in function 'error'
    /Users/Meirtz/torch/install/share/lua/5.1/trepl/init.lua:384: in function 'require'
    [string "_RESULT={require 'camera'}"]:1: in main chunk
    [C]: in function 'xpcall'
    /Users/Meirtz/torch/install/share/lua/5.1/trepl/init.lua:651: in function 'repl'
    ...irtz/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:199: in main chunk
    [C]: at 0x0106258bd0    
                                                                      [0.0096s]


Any reply I will appreciate it

error finding cv.h

Anytime I try to do luarocks install camera, I get this following error:

Scanning dependencies of target camopencv
[ 25%] Building C object opencv/CMakeFiles/camopencv.dir/opencv.c.o
/tmp/luarocks_camera-1.1-0-18/lua---camera/opencv/opencv.c:29:16: fatal error: cv.h: No such file or directory
 #include <cv.h>
                ^
compilation terminated.
make[2]: *** [opencv/CMakeFiles/camopencv.dir/opencv.c.o] Error 1
make[1]: *** [opencv/CMakeFiles/camopencv.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed building.

I also have opencv 3.0.0 installed on Ubuntu 14.04 LTS.

installation problem

Encountered below message during installation. Please help!!!

CMake Warning at video4linux/CMakeLists.txt:13 (FIND_PACKAGE):
  By not providing "FindARM.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "ARM", but
  CMake did not find one.

  Could not find a package configuration file provided by "ARM" with any of
  the following names:

    ARMConfig.cmake
    arm-config.cmake

  Add the installation prefix of "ARM" to CMAKE_PREFIX_PATH or set "ARM_DIR"
  to a directory containing one of the above files.  If "ARM" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/luarocks_camera-1.1-0-2868/lua---camera/build
Scanning dependencies of target camopencv
[ 50%] Building C object opencv/CMakeFiles/camopencv.dir/opencv.c.o
/tmp/luarocks_camera-1.1-0-2868/lua---camera/opencv/opencv.c:29:16: fatal error: cv.h: No such file or directory
 #include <cv.h>
                ^
compilation terminated.
make[2]: *** [opencv/CMakeFiles/camopencv.dir/opencv.c.o] Error 1
make[1]: *** [opencv/CMakeFiles/camopencv.dir/all] Error 2
make: *** [all] Error 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.