Giter VIP home page Giter VIP logo

v4l-lua's Introduction

v4l-lua is a small library binding V4L2 CAMERA API to Lua. 
See the example "capture.lua" to see how easy is to capture from V4L2 cameras :D
To compile v4l-lua, you'll need the v4lconvert and Lua development files.

WARNING: THIS LIBRARY STILL IS IN ALPHA STAGE! Plese, report bugs ;)

Usage:

local v4l = require 'v4l'

dev = v4l.open(device_name, width, height)
    -- opens a v4l camera, where: device_name is usually '/dev/video0', and the
    -- optional params width and height can be used to suggest a resolution,
    -- although a similar one may be chosen...

array = dev:getframe()
    -- returns a table with the rgb values for the pixels from left to right
    -- top to bottom, in other words the the pixel (x,y) will appear at
    -- array[c + 3 * (x + y * dev:width())], assuming (0,0) to be the
    -- top left corner, and c=1 for red, c=2 for green and c=3 for blue.

str = dev:getframestr()
    -- similar to getframe, but the values will be returned via a string
    -- instead of a table; you can use the string.byte for fast access.

w = dev:width()  -- return effective width
h = dev:height() -- and effective height
fd = dev:fd()    -- file descriptor number, if you need it for concurrent I/O with other files
dev:close()      -- closes the camera freeing any resources

v4l-lua's People

Contributors

fcr-- avatar gabrield avatar

Stargazers

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

Watchers

 avatar

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.