Skip to content

Instantly share code, notes, and snippets.

Avatar

Lloyd Henning eldog

View GitHub Profile
@eldog
eldog / mediapipe_hands_world_space.py
Last active February 28, 2023 11:09
Google Mediapipe Hand Tracking to World Space using OpenCV solvePnP, rendered in OpenGL using PyGame
View mediapipe_hands_world_space.py
import cv2
import pygame
import math
import mediapipe as mp
import numpy as np
from PIL import Image
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
@eldog
eldog / BackgroundRemoval.pde
Created February 6, 2017 21:20
Removes the background using processing.
View BackgroundRemoval.pde
import processing.video.*;
import gab.opencv.*;
Capture liveCam;
PImage camCapture, foregroundMask, screenshot;
OpenCV opencv;
int width = 640;
int height = 480;
View BackgroundMask.pde
// Import Libraries - install these if necessary.
import processing.video.*;
import gab.opencv.*;
//create Capture
Capture liveCam;
//create PImages
PImage camCapture, foregroundMask, backgroundMask, screenshot;
float comparVal = 0.25;
@eldog
eldog / oauth.coffee
Created January 11, 2014 20:19
Oauth monkey patch to get meteor oauth accounts to work in a cordova app
View oauth.coffee
Meteor.startup ->
Package.oauth.Oauth.initiateLogin = initiateLogin
getHostnameFromUrl = (url) ->
aEl = document.createElement 'a'
aEl.href = url
aEl.hostname
initiateLogin = (credentialToken,
url,
@eldog
eldog / android_canvas_save.java
Created August 7, 2011 13:24
Saving android canvas
View android_canvas_save.java
// Save the canvas to file "check.jpg" on SDCard
public void saveCanvas() throws IOException
{
// Write the canvas to file
FileOutputStream fos;
try
{
fos = new FileOutputStream("/sdcard/check.jpg");
mBitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
fos.flush();