This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import camera | |
capture = camera.Camera() | |
capture.capture_to_file('image.jpg') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2.7 | |
''' | |
Author: Igor Maculan - [email protected] | |
A Simple mjpg stream http server | |
Modified for DSLR interface by Zoetrope Ltd. | |
''' | |
from PIL import Image | |
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer | |
import StringIO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def setManualFocus(cam, focusPoint): | |
focusList = ['Near 1', 'Near 2', 'Near 3', 'None', 'Far 1', 'Far 2', 'Far 3'] | |
conf = camera.Config(cam) | |
root = conf.get_root_widget() | |
child = root.get_child_by_name("manualfocusdrive") | |
child.set_value(focusList[focusPoint]) | |
conf.set_config() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def estimateFocus(file, s=5): | |
im = Image.open(file).convert("L") | |
w,h = im.size | |
box = (w/2 - 50, h/2 - 50, w/2 + 50, h/2 + 50) | |
im = im.crop(box) | |
imf = im.filter(ImageFilter.MedianFilter(s)) | |
d = ImageChops.subtract(im, imf, 1, 100) | |
return ImageStat.Stat(d).stddev[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
''' | |
Author: Zoetrope Ltd. | |
MJPEG stream from DSLR with autofocus | |
Based on Igor Maculan's simple mjpg http server: | |
https://gist.github.com/n3wtron/4624820 | |
''' | |
import camera | |
from PIL import Image, ImageFilter, ImageChops, ImageStat, ImageDraw | |
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am bitdivision on github. | |
* I am rfwebb (https://keybase.io/rfwebb) on keybase. | |
* I have a public key whose fingerprint is 014C 1CDC A774 028B 41DC 5523 99B9 54C8 BB77 17F2 | |
To claim this, I am signing this object: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var testPage = require('./testPage.js'); | |
var protractor = require('protractor'); | |
describe('Desktop testing', function() { | |
it('should display the widget when a zBoxElement is tapped', function() { | |
testPage.navigate(); | |
testPage.openWidget(); | |
expect(testPage.widgetColorbox.isDisplayed()).toBe(true); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Gif | |
convert -delay 20 -loop 0 *.jpg output.gif | |
### WebP (lossless) | |
for file in *.jpg; do cwebp -lossless ${file} -o ${file%.jpg}.webp; done | |
webpmux -frame 0000.webp +0+0+200 ... -o output.webp | |
### WebP (lossy) | |
for file in *.jpg; do cwebp ${file} -o ${file%.jpg}.webp; done | |
webpmux -frame 0000.webp +0+0+200 ... -o output.webp | |
### x264 (lossless) | |
ffmpeg -r 8 -i %04d.jpg -vcodec libx264 -crf 0 -y output.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include "nRF24L01.h" | |
#include "RF24.h" | |
#include "printf.h" | |
// Hardware configuration: Set up nRF24L01 radio on SPI bus plus pins 9 & 10 for CE and CSn | |
RF24 radio(9,10); | |
uint64_t addresses[] = {0x5544332200LL,0x5544332201LL}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Set up a Node.js environment | |
language: node_js | |
node_js: | |
- '0.10' | |
env: | |
global: | |
secure: "ecVAPtm1YNT4USYEbG5lnLnQ9pBWSDKHdjhUbQSk35UvunixLOvU/oeHzWqTIoDxEFKf0HehSXW9tM569bsBZth9O7WBwJAhSNkUrPVF4WDT1p+zsuakSZuZTAEVCqbeL+pPdVR968ML1UKP0hLgTbgDvM9HpyM4YQxVAOXfskI=" | |
#Include the Sauce Connect plugin to allow tunneling. |
OlderNewer