Skip to content

Instantly share code, notes, and snippets.

View weedge's full-sized avatar
🍀
coding at home

weedge weedge

🍀
coding at home
View GitHub Profile
@weedge
weedge / videoToClientSocket.py
Created September 29, 2017 16:15
simple video op by using picamera
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# look this: http://picamera.readthedocs.io/en/release-1.2/recipes1.html
import io
import os
import sys
import random
import time
import struct
@weedge
weedge / photographToClientSocket.py
Last active September 29, 2017 14:03
simple client photograph to socket in PI (use picamera)
import io
import socket
import struct
import time
import picamera
from PIL import Image
import cv2
import numpy as np
def photographToFile():
@weedge
weedge / photographTOServerSocket.py
Last active September 29, 2017 13:58
simple photograph server
import io
import socket
import struct
#u should do this:
# pip install --upgrade pip
# pip install image
from PIL import Image
# NOTICE:
# The server script should be run first (don't run in pi)·
# to ensure there’s a listening socket ready to accept a connection from the client script