Skip to content

Instantly share code, notes, and snippets.

#import the SimpleCV library
from SimpleCV import *
#initialize the camera
cam = Camera()
#grab the image from the camera
img = cam.getImage()
#show the image in a new window
img.show()
#import the SimpleCV library
from SimpleCV import *
#initialize the camera
cam = Camera()
#grab the camera image and apply different filters
original = cam.getImage()
gray = cam.getImage().toGray()
inverted = cam.getImage().invert()
#import the SimpleCV library
from SimpleCV import *
#initialize the camera
cam = Camera()
#set the maximum display size
display = Display((800,600))
#create a loop to constantly get a new image from the camera
while True:
#import the SimpleCV library
from SimpleCV import *
#initialize the camera
cam = Camera()
#set the maximum display size
display = Display((800,600))
#set a variable for the motion threshold
'''PYTHON GMAILER
This code is intended to send
messages with attachments
through gmail using python.
________________________________
How to get this code working
________________________________
INSTALL KEYRING
-pip install keyring
INSTALL KEYRING ALT
'''THIS IS A MOTION DETECTING PROGRAM FOR THE RASPBERRY PI
It is part of a tutorial series that you can find here:
https://www.youtube.com/playlist?list=PLlg8lN4r9qWiDzF13lJY-lGtiTFHHGcpx
Running this program requires installing SimpleCV as well as
a few other prerequisits on your pi. You can find detailed
instructions for how to do that here:
http://tinkernut.com/YtQH9
'''
#!/usr/bin/python
'''THIS IS A MOTION DETECTING PROGRAM FOR THE RASPBERRY PI
It is part of a tutorial series that you can find here:
https://www.youtube.com/playlist?list=PLlg8lN4r9qWiDzF13lJY-lGtiTFHHGcpx
Running this program requires installing SimpleCV as well as
a few other prerequisits on your pi. You can find detailed
instructions for how to do that here:
http://tinkernut.com/YtQH9
'''
#!/usr/bin/python
@gigafide
gigafide / simple_arduino_smartwatch.ino
Created June 10, 2016 19:46
Simple Arduino Smartwatch code
#include <PCF8814.h>
static const byte ledPin = 13;
static const byte LCD_WIDTH = 96;
static const byte LCD_HEIGHT = 65;
static PCF8814 lcd;
void setup() {
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
pinMode(ledPin, OUTPUT);
@gigafide
gigafide / tinkerwatch.ino
Created June 24, 2016 20:26
Arduino smartwatch code
/*******************
* This code requires the PCF8814 library found here:
* https://github.com/cattzalin/Arduino-library-nokia-1100-lcd--PCF8814
*
* This Arduino program is intended to be used as a smartwatch
* using parts from a Nokia 1100 cell phone. It will only work in
* conjunction with the Android app that you can find here:
*
* For more details on how to create your own smartwatch,
* you can visit this website:
from SimpleCV import Camera, VideoStream, Color, Display, Image, VirtualCamera
import cv2
import numpy as np
import time
# build the mapping
def buildMap(Ws,Hs,Wd,Hd,R1,R2,Cx,Cy):
map_x = np.zeros((Hd,Wd),np.float32)
map_y = np.zeros((Hd,Wd),np.float32)
for y in range(0,int(Hd-1)):