Skip to content

Pi camera interface: live on pi -> test data on local dev

Notifications You must be signed in to change notification settings

khrome/pi-camera-shim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

pi-camera-shim

Use a camera when local to pi, use test data(still images) when on a local system.

Usage

In an app:

var shim = require('pi-camera-shim');
shim.pullAndProcessLoop(function(err, image, advance, terminate){
    //set the actual bytes to something
    el.setAttribute('src', image.base64Image);
    //pull another image
    advance();
    //todo: process image
}, 'path/to/test/image/directory');

In a test suite, to force the app into test mode in the directory provided in the call:

shim.pcMode = true;

In a test suite, to force the app into a specific directory

shim.pcMode = '/path/to/the/dir';

To save 100 images from the Camera:

shim.saveFrames('path/to/test/image/directory', function(err, count){
    //done, frames in path/to/test/image/directory/image-0.jpg - image-<count>.jpg
});

About

Pi camera interface: live on pi -> test data on local dev

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published