This file contains 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 skimage.transform | |
from PIL import Image | |
from skimage import data | |
import numpy as np | |
if __name__ == "__main__": | |
#Load source image | |
srcIm = data.lena() | |
#Define control points for warp |
This file contains 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
//To compile: | |
//cc vlcsms.c -o vlcsms -lvlc | |
//This source is by Tim Sheerman-Chase and it is released as public domain. | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <inttypes.h> | |
#include <vlc/vlc.h> |
This file contains 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
#Convert from PIL Image and Numpy array to PyPNG format | |
#By Tim Sheerman-Chase, 2013 | |
#This code is released as CC0 and public domain code. Do what you will! | |
import png | |
from PIL import Image | |
import numpy as np | |
class NumpyArrayToPyPngAdapter: | |
def __init__(self, img): |
This file contains 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
//Generate an RSA key pair, sign a message and verify it using crypto++ 5.6.1 or later. | |
//By Tim Sheerman-Chase, 2013 | |
//This code is in the public domain and CC0 | |
//To compile: g++ gen.cpp -lcrypto++ -o gen | |
#include <string> | |
using namespace std; | |
#include <crypto++/rsa.h> | |
#include <crypto++/osrng.h> | |
#include <crypto++/base64.h> |
This file contains 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
''' | |
QT4 Webcam demo in python | |
Copyright (c) 2013, Tim Sheerman-Chase | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. |
This file contains 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 urllib2, json, StringIO | |
from PIL import Image | |
if __name__=="__main__": | |
urlHandle = urllib2.urlopen("http://192.168.1.9/photodb/getsamples.php") | |
sampleJson = urlHandle.read() | |
sampleList = json.loads(sampleJson) | |
for sample in sampleList: | |
print sample |
This file contains 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
# cython: profile=True | |
# cython: cdivision=True | |
# cython: boundscheck=False | |
# cython: wraparound=False | |
import cmath, math | |
cimport numpy as np | |
import numpy as np | |
''' | |
Based on _hog.py from https://github.com/scikit-image/scikit-image |
This file contains 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
#Filter KML by way type | |
#by Tim Sheerman-Chase, 2013 | |
#This file may be used under CC0, http://creativecommons.org/publicdomain/zero/1.0/ | |
import xml.etree.ElementTree as ET | |
import sys | |
def GetMetaData(place): | |
out = {} |
This file contains 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
# pyODE example 3: Collision detection | |
# Originally by Matthias Baas. | |
# Updated by Pierre Gay to work without pygame or cgkit. | |
import sys, os, random, time | |
from math import * | |
from OpenGL.GL import * | |
from OpenGL.GLU import * | |
from OpenGL.GLUT import * |
This file contains 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
SCREEN_SIZE = (800, 600) | |
import math | |
from OpenGL.GL import * | |
from OpenGL.GLU import * | |
import pygame | |
from pygame.locals import * |
OlderNewer