Skip to content

Instantly share code, notes, and snippets.

@pdp7
pdp7 / pygame-pi-zero-webcam-notes.txt
Created April 3, 2016 09:01
raspberry pi zero pygame camera with png overlay
Video: pygame camera with png overlay
https://www.youtube.com/watch?v=OITenUQi0hI
Video: Python pygame camera demo on Raspberry Pi zero with USB webcam
https://www.youtube.com/watch?v=gncRJMv8pjY
I am running demo code from:
https://gist.github.com/pdp7/1a695f7ed51e47548832c789809b326f
It is running on raspberry Pi Zero with the Raspbian Jessie image from November 2015. I am using the PlayStation Eye USB camera.
@radames
radames / opencv_video_to_pygame_raspberry_pi.py
Last active August 11, 2022 17:55
OpenCV VideoCapture running on PyGame on Raspberry PI
import pygame
from pygame.locals import *
import cv2
import numpy as np
import time
import picamera
import picamera.array
screen_width = 640
@mik30s
mik30s / webcam_capture.cpp
Last active October 26, 2024 01:20
Simple C++ program to capture a webcam frame in Linux
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <linux/ioctl.h>
#include <linux/types.h>
#include <linux/v4l2-common.h>
#include <linux/v4l2-controls.h>
#include <linux/videodev2.h>
#include <fcntl.h>
#include <unistd.h>
@tkhduracell
tkhduracell / fix.sh
Last active September 16, 2024 07:15
Fix locale on raspberry pi (raspbian) "Setting locale failed."
#
# How to get rid of the locale warning on raspberry pi
#
sudo sed -i "s/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g" -i /etc/locale.gen
sudo locale-gen en_US.UTF-8
sudo update-locale en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
#include <errno.h>
#include <fcntl.h>
#include <linux/videodev2.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <opencv2/core/core.hpp>
@fishkingsin
fishkingsin / mjpg_streamer.sh
Last active April 1, 2023 17:19
raspberry pi mjpg_streamer startup script
#!/bin/sh
# /etc/init.d/mjpg_streamer.sh
# v0.2 phillips321.co.uk
### BEGIN INIT INFO
# Provides: mjpg_streamer.sh
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: mjpg_streamer for webcam
@abishur
abishur / control.php
Created February 15, 2013 03:40
php web control for GPIO of raspberry pi. The main application is for a spinkler system, but ultimately it can do automatic control of any relay control by the raspberry pi
<?php
session_start();
//////////////////////////////
// EDIT THESE TWO VARIABLES //
//////////////////////////////
$MySQLUsername = "USERNAME HERE";
$MySQLPassword = "PASSWORD HERE";
/////////////////////////////////
// DO NOT EDIT BELOW THIS LINE //